| Server IP : 43.130.17.34 / Your IP : 216.73.217.6 Web Server : nginx/1.28.0 System : Linux VM-4-12-opencloudos 6.6.92-34.1.oc9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 25 21:32:13 CST 2025 x86_64 User : www ( 1000) PHP Version : 8.0.26 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/yespkg.com/wp-content/plugins/admin-menu-editor-pro/includes/ |
Upload File : |
<?php
if ( !defined('ABSPATH') ) {
die();
}
/** @var string $pluginFile Should be provided by the including file. */
$log = array();
$log[] = sprintf(
'[OK] Main plugin file: %s',
$pluginFile
);
$log[] = sprintf(
'[Info] WordPress version: %s',
$GLOBALS['wp_version']
);
$log[] = sprintf(
'[Info] WP_PLUGIN_DIR: %s',
WP_PLUGIN_DIR
);
$log[] = sprintf(
'[Info] WP_PLUGIN_URL: %s',
WP_PLUGIN_URL
);
$log[] = sprintf(
'[Info] WPMU_PLUGIN_DIR: %s',
WPMU_PLUGIN_DIR
);
$log[] = sprintf(
'[Info] WPMU_PLUGIN_URL: %s',
WPMU_PLUGIN_URL
);
$expectedPluginRoot = dirname(dirname(__FILE__));
$actualPluginRoot = dirname($pluginFile);
if ( $expectedPluginRoot === $actualPluginRoot ) {
$log[] = sprintf(
'[OK] Plugin root directory is "%s"',
$actualPluginRoot
);
} else {
$log[] = sprintf(
'[Error] Actual plugin directory: "%s", expected: "%s"',
$actualPluginRoot,
$expectedPluginRoot
);
}
$requiredFiles = array(
'css/menu-editor.css',
'css/jquery.qtip.min.css',
'js/menu-editor.js',
'js/menu-highlight-fix.js',
'js/jquery.sort.js',
'js/jquery.qtip.min.js',
'images/cut.png',
'images/delete.png',
'images/page_white_add.png',
'images/spinner.gif',
'includes/editor-page.php',
'includes/menu-editor-core.php',
'modules/access-editor/access-editor-template.php',
'includes/menu-item.php',
'menu-editor.php',
'uninstall.php',
);
foreach($requiredFiles as $filename) {
$fullPath = dirname($pluginFile) . '/' . $filename;
if ( is_readable($fullPath) ) {
$log[] = sprintf(
'[OK] File exists: %s',
$fullPath
);
} else {
$log[] = sprintf(
'[Error] File does not exist: %s',
$fullPath
);
}
}
foreach($requiredFiles as $filename) {
if ( !preg_match('@\.(css|js|png)$@', $filename) ) {
continue;
}
$url = plugins_url($filename, $pluginFile);
$log[] = ame_test_url_access($url, $filename);
}
echo '<pre>';
$divider = str_repeat('-', 50);
echo "File consistency checks:\n", esc_html($divider), "\n";
foreach($log as $message) {
echo esc_html($message), "\n";
}
//Test for buggy plugins_url filters.
echo esc_html($divider), "\nTesting for problems with the 'plugins_url' hook...\n";
add_filter('plugins_url', 'ame_plugins_url_test_first', -9999, 3);
add_filter('plugins_url', 'ame_plugins_url_test_last', 9999, 3);
$url = plugins_url('css/menu-editor.css', $pluginFile);
remove_filter('plugins_url', 'ame_plugins_url_test_first', -9999, 3);
remove_filter('plugins_url', 'ame_plugins_url_test_last', 9999, 3);
function ame_plugins_url_test_first($url, $path = '', $plugin = '') {
printf(
'[Info] plugins_url() output before plugin hooks: %s' . "\n",
esc_html($url)
);
echo esc_html(ame_test_url_access($url, 'css/menu-editor.css')), "\n";
return $url;
}
function ame_plugins_url_test_last($url, $path = '', $plugin = '') {
printf(
'[Info] plugins_url() output after plugin hooks: %s' . "\n",
esc_html($url)
);
echo esc_html(ame_test_url_access($url, 'css/menu-editor.css')), "\n";
return $url;
}
function ame_test_url_access($url, $filename) {
$result = wp_remote_get($url);
if ( is_wp_error($result) ) {
return sprintf(
'[Error] Can not load URL: %s (%s)',
$url,
$result->get_error_message()
);
} else if ( $result['response']['code'] == 200 ) {
return sprintf(
'[OK] URL is accessible: %s',
$url
);
} else {
return sprintf(
'[Error] Can not load "%s", URL : %s (%d %s)',
$filename,
$url,
$result['response']['code'],
$result['response']['message']
);
}
}
echo esc_html($divider);
echo '</pre>';