浏览代码

set plugin basenames

master
thomas.fellinger 5 年前
父节点
当前提交
1a8773908a
共有 3 个文件被更改,包括 13 次插入13 次删除
  1. +3
    -3
      sandbox-adaptions/sandbox-adaptions.php
  2. +2
    -2
      sandbox-stats.php
  3. +8
    -8
      sandbox-stats/sandbox-stats.php

+ 3
- 3
sandbox-adaptions/sandbox-adaptions.php 查看文件

@@ -23,8 +23,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */


define('SOCOS_IO_ADAPTIONS_PATH', plugin_dir_path(__FILE__));
define('SOCOS_IO_ADAPTIONS_URL', plugin_dir_url(__FILE__));
define('SANDBOX_ADAPTIONS_PATH', plugin_dir_path(__FILE__));
define('SANDBOX_ADAPTIONS_URL', plugin_dir_url(__FILE__));


/** /**
* Ajax hooks * Ajax hooks
@@ -271,7 +271,7 @@ function sandbox_admin_body_class($classes){


// add custom styles for admin section // add custom styles for admin section
function sandbox_admin_styles_load(){ function sandbox_admin_styles_load(){
wp_register_style('sandbox_admin', SOCOS_IO_ADAPTIONS_URL . '/admin/style.css');
wp_register_style('sandbox_admin', SANDBOX_ADAPTIONS_URL . '/admin/style.css');
wp_enqueue_style('sandbox_admin'); wp_enqueue_style('sandbox_admin');
} }




+ 2
- 2
sandbox-stats.php 查看文件

@@ -1,6 +1,6 @@
<?php <?php
/** /**
* Plugin name: socos.io stats
* Plugin name: sandbox stats
* Plugin URI: https://www.netzgestaltung.at * Plugin URI: https://www.netzgestaltung.at
* Author: Thomas Fellinger * Author: Thomas Fellinger
* Author URI: https://www.netzgestaltung.at * Author URI: https://www.netzgestaltung.at
@@ -27,6 +27,6 @@
* @see https://wordpress.org/support/article/must-use-plugins/ * @see https://wordpress.org/support/article/must-use-plugins/
* @see https://premium.wpmudev.org/blog/why-you-shouldnt-use-functions-php/ * @see https://premium.wpmudev.org/blog/why-you-shouldnt-use-functions-php/
*/ */
require WPMU_PLUGIN_DIR . '/socos-io-stats/socos-io-stats.php';
// require WPMU_PLUGIN_DIR . '/sandbox-stats/sandbox-stats.php';
?> ?>



+ 8
- 8
sandbox-stats/sandbox-stats.php 查看文件

@@ -1,6 +1,6 @@
<?php <?php
/** /**
* Plugin name: socos.io adaptions
* Plugin name: sandbox adaptions
* Plugin URI: https://www.netzgestaltung.at * Plugin URI: https://www.netzgestaltung.at
* Author: Thomas Fellinger * Author: Thomas Fellinger
* Author URI: https://www.netzgestaltung.at * Author URI: https://www.netzgestaltung.at
@@ -22,8 +22,8 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
define('SOCOS_IO_STATS_PATH', plugin_dir_path(__FILE__));
define('SOCOS_IO_STATS_URL', plugin_dir_url(__FILE__));
define('SANDBOX_STATS_PATH', plugin_dir_path(__FILE__));
define('SANDBOX_STATS_URL', plugin_dir_url(__FILE__));


/** /**
* Plugin setup hook * Plugin setup hook
@@ -64,15 +64,15 @@ function sandbox_setup_stats() {
* License: GNU General Public License v2.0 * License: GNU General Public License v2.0
*/ */
function sandbox_get_matomo_tracker(){ function sandbox_get_matomo_tracker(){
include_once(SOCOS_IO_STATS_PATH . '/config.php');
include_once(SOCOS_IO_STATS_PATH . '/MatomoTracker.php');
include_once(SANDBOX_STATS_PATH . '/config.php');
include_once(SANDBOX_STATS_PATH . '/MatomoTracker.php');


MatomoTracker::$URL = SOCOS_IO_STATS_TRACKER_URL;
$matomoTracker = new MatomoTracker(SOCOS_IO_STATS_SITE_ID);
MatomoTracker::$URL = SANDBOX_STATS_TRACKER_URL;
$matomoTracker = new MatomoTracker(SANDBOX_STATS_SITE_ID);


// Specify an API token with at least Write permission, so the Visitor IP address can be recorded // Specify an API token with at least Write permission, so the Visitor IP address can be recorded
// Learn more about token_auth: https://matomo.org/faq/general/faq_114/ // Learn more about token_auth: https://matomo.org/faq/general/faq_114/
$matomoTracker->setTokenAuth(SOCOS_IO_STATS_AUTH_TOKEN);
$matomoTracker->setTokenAuth(SANDBOX_STATS_AUTH_TOKEN);


// You can manually set the visitor details (resolution, time, plugins, etc.) // You can manually set the visitor details (resolution, time, plugins, etc.)
// See all other ->set* functions available in the MatomoTracker.php file // See all other ->set* functions available in the MatomoTracker.php file


正在加载...
取消
保存