icon-128x128
  • 10% plugin-disabler

    Code Review | Plugin Disabler

    WordPress plugin Plugin Disabler scored10%from 54 tests.

    About plugin

    • Plugin page: plugin-disabler
    • Plugin version: 1.0
    • PHP version: 7.4.16
    • WordPress compatibility: 5.2.4-5.2.4
    • WordPress version: 6.3.1
    • First release: Nov 15, 2019
    • Latest release: Nov 15, 2019
    • Number of updates: 7
    • Update frequency: every 0.3 days
    • Top authors: akosicb (100%)

    Code review

    54 tests

    User reviews

    1 review

    Install metrics

    400+ active /1,319 total downloads

    Benchmarks

    Plugin footprint 40% from 16 tests

    Installer 0% from 1 test

    🔺 Critical test (weight: 50) | Checking the installer triggered no errors
    Please fix the following installer errors
    • The plugin did not install without errors
      • > Warning in wp-content/plugins/plugin-disabler/autoload.class.php+38
      fopen(wp-content/mu-plugins/pdm.php): failed to open stream: No such file or directory

    Server metrics [RAM: ▼1.90MB] [CPU: ▼51.37ms] Passed 4 tests

    A check of server-side resources used by Plugin Disabler
    Server-side resource usage in normal parameters
    PageMemory (MB)CPU Time (ms)
    Home /2.08 ▼1.384.67 ▼35.43
    Dashboard /wp-admin2.10 ▼1.206.10 ▼40.95
    Posts /wp-admin/edit.php2.10 ▼1.257.08 ▼45.16
    Add New Post /wp-admin/post-new.php2.10 ▼3.787.06 ▼83.94
    Media Library /wp-admin/upload.php2.10 ▼1.127.24 ▼27.33
    Plugin Disabler /wp-admin/tools.php?page=pi-settings-page2.106.36

    Server storage [IO: ▲0.03MB] [DB: ▲0.00MB] Passed 3 tests

    A short overview of filesystem and database impact
    No storage issues were detected
    Filesystem: 8 new files
    Database: no new tables, 7 new options
    New WordPress options
    widget_recent-posts
    can_compress_scripts
    pi_post_types
    theysaidso_admin_options
    widget_theysaidso_widget
    widget_recent-comments
    db_upgraded

    Browser metrics Passed 4 tests

    An overview of browser requirements for Plugin Disabler
    Normal browser usage
    PageNodesMemory (MB)Script (ms)Layout (ms)
    Home /2,806 ▲7113.54 ▼0.731.70 ▼0.2839.26 ▼10.72
    Dashboard /wp-admin2,212 ▲245.85 ▲0.94107.93 ▲8.0139.85 ▼5.39
    Posts /wp-admin/edit.php2,095 ▲62.06 ▲0.0136.02 ▼5.2933.42 ▼6.00
    Add New Post /wp-admin/post-new.php6,237 ▲4,69221.56 ▲3.30895.26 ▲283.2658.50 ▲1.54
    Media Library /wp-admin/upload.php1,394 ▲34.22 ▼0.0793.65 ▼3.1341.40 ▼4.92
    Plugin Disabler /wp-admin/tools.php?page=pi-settings-page8702.0629.0729.92

    Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

    🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
    The following items require your attention
    • This plugin did not uninstall without warnings or errors
      • > Warning in wp-content/plugins/plugin-disabler/autoload.class.php+38
      fopen(wp-content/mu-plugins/pdm.php): failed to open stream: No such file or directory
    • Zombie WordPress options were found after uninstall: 7 options
      • pi_post_types
      • widget_recent-posts
      • widget_recent-comments
      • db_upgraded
      • theysaidso_admin_options
      • can_compress_scripts
      • widget_theysaidso_widget

    Smoke tests 25% from 4 tests

    Server-side errors 0% from 1 test

    🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
    These errors were triggered by the plugin
      • > GET request to /wp-admin/tools.php?page=pi-settings-page
      • > Warning in wp-content/plugins/plugin-disabler/autoload.class.php+38
      fopen(wp-content/mu-plugins/pdm.php): failed to open stream: No such file or directory
      • > GET request to /wp-admin/tools.php?page=pi-settings-page
      • > Warning in wp-content/plugins/plugin-disabler/autoload.class.php+39
      fwrite() expects parameter 1 to be resource, bool given
      • > GET request to /wp-admin/tools.php?page=pi-settings-page
      • > Warning in wp-content/plugins/plugin-disabler/autoload.class.php+40
      fclose() expects parameter 1 to be resource, bool given
      • > GET request to /wp-admin/tools.php?page=pi-settings-page
      • > Notice in wp-content/plugins/plugin-disabler/classes/autoload/pibackend_ui.class.php+42
      Undefined index: pi_hp_nonce_field
      • > GET request to /wp-admin/tools.php?page=pi-settings-page
      • > Notice in wp-content/plugins/plugin-disabler/classes/autoload/pibackend_ui.class.php+70
      Undefined index: pi_op_nonce_field

    SRP 50% from 2 tests

    🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
    Almost there! Just fix the following items
    • 13× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
      • > PHP Warning
        Use of undefined constant WPEH_PI_PLUGIN_PATH - assumed 'WPEH_PI_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/plugin-disabler/autoload.class.php on line 17
      • > PHP Fatal error
        Uncaught Error: Call to undefined function add_action() in wp-content/plugins/plugin-disabler/classes/plugin-disabler-mu.php:5
      • > PHP Warning
        scandir(WPEH_PI_PLUGIN_PATH/classes/autoload): failed to open dir: No such file or directory in wp-content/plugins/plugin-disabler/autoload.class.php on line 19
      • > PHP Warning
        fopen(WPMU_PLUGIN_DIR/pdm.php): failed to open stream: No such file or directory in wp-content/plugins/plugin-disabler/autoload.class.php on line 38
      • > PHP Warning
        Use of undefined constant WPMU_PLUGIN_DIR - assumed 'WPMU_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/plugin-disabler/autoload.class.php on line 38
      • > PHP Warning
        Invalid argument supplied for foreach() in wp-content/plugins/plugin-disabler/autoload.class.php on line 22
      • > PHP Warning
        fclose() expects parameter 1 to be resource, bool given in wp-content/plugins/plugin-disabler/autoload.class.php on line 40
      • > PHP Warning
        scandir(): (errno 2): No such file or directory in wp-content/plugins/plugin-disabler/autoload.class.php on line 19
      • > PHP Warning
        Use of undefined constant WPMU_PLUGIN_DIR - assumed 'WPMU_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/plugin-disabler/autoload.class.php on line 32
      • > PHP Warning
        fwrite() expects parameter 1 to be resource, bool given in wp-content/plugins/plugin-disabler/autoload.class.php on line 39

    User-side errors 0% from 1 test

    🔹 Test weight: 20 | This is a shallow check for browser errors
    Please take a look at the following user-side issues
      • > GET request to /wp-admin/tools.php?page=pi-settings-page
      • > Network (severe)
      https://www.paypalobjects.com/en_PH/i/scr/pixel.gif - Failed to load resource: the server responded with a status of 404 ()

    Optimizations

    Plugin configuration 93% from 29 tests

    readme.txt Passed 16 tests

    The readme.txt file uses markdown syntax to describe your plugin to the world
    6 plugin tags: disable plugin on pages, gtmetrix optimization, plugin remoevr, pagespeed optimization, optimization...

    plugin-disabler/wpeh-plugin-disabler.php 85% from 13 tests

    "Plugin Disabler" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
    Please make the necessary changes and fix the following:
    • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 272 characters long)
    • Main file name: Name the main plugin file the same as the plugin slug ("plugin-disabler.php" instead of "wpeh-plugin-disabler.php")

    Code Analysis Passed 3 tests

    File types Passed 1 test

    🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
    No dangerous file extensions were detected411 lines of code in 6 files:
    LanguageFilesBlank linesComment linesLines of code
    PHP511316329
    CSS13082

    PHP code Passed 2 tests

    This is a short overview of cyclomatic complexity and code structure for this plugin
    There were no cyclomatic complexity issued detected
    Cyclomatic complexity
    Average complexity per logical line of code0.35
    Average class complexity10.33
    ▷ Minimum class complexity5.00
    ▷ Maximum class complexity18.00
    Average method complexity2.75
    ▷ Minimum method complexity1.00
    ▷ Maximum method complexity7.00
    Code structure
    Namespaces0
    Interfaces0
    Traits0
    Classes3
    ▷ Abstract classes00.00%
    ▷ Concrete classes3100.00%
    ▷ Final classes00.00%
    Methods13
    ▷ Static methods17.69%
    ▷ Public methods13100.00%
    ▷ Protected methods00.00%
    ▷ Private methods00.00%
    Functions1
    ▷ Named functions00.00%
    ▷ Anonymous functions1100.00%
    Constants2
    ▷ Global constants2100.00%
    ▷ Class constants00.00%
    ▷ Public constants00.00%

    Plugin size Passed 2 tests

    Image compression Passed 2 tests

    PNG files should be compressed to save space and minimize bandwidth usage
    No PNG images were found in this plugin