84% wptoggler

Code Review | WPToggler

WordPress plugin WPToggler scored84%from 54 tests.

About plugin

  • Plugin page: wptoggler
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.1-4.3.1
  • WordPress version: 6.3.1
  • First release: Dec 1, 2015
  • Latest release: Dec 1, 2015
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: larjen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /508 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.07ms] Passed 4 tests

An overview of server-side resources used by WPToggler
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0142.12 ▲4.33
Dashboard /wp-admin3.36 ▲0.0148.35 ▼19.08
Posts /wp-admin/edit.php3.40 ▲0.0549.06 ▼0.89
Add New Post /wp-admin/post-new.php5.93 ▲0.0594.20 ▼0.70
Media Library /wp-admin/upload.php3.28 ▲0.0534.34 ▲0.40
WPToggler /wp-admin/tools.php?page=WPTogglerAdmin3.2431.53

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 14 new options
New WordPress options
WPToggler_switched_to_true
WPToggler_option_label_false
widget_recent-comments
widget_theysaidso_widget
WPToggler_description
WPToggler_MESSAGES
WPToggler_option_label
WPToggler_title
db_upgraded
can_compress_scripts
...

Browser metrics Passed 4 tests

An overview of browser requirements for WPToggler
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,866 ▲9513.65 ▼0.651.56 ▼0.3540.59 ▼1.29
Dashboard /wp-admin2,269 ▲815.82 ▼0.0495.80 ▼0.5239.23 ▼3.66
Posts /wp-admin/edit.php2,093 ▲42.05 ▲0.0140.07 ▲0.0933.12 ▼3.60
Add New Post /wp-admin/post-new.php1,532 ▲1818.43 ▲0.88636.67 ▼44.7356.19 ▼4.32
Media Library /wp-admin/upload.php1,392 ▲14.20 ▼0.0097.23 ▼3.2141.77 ▼2.64
WPToggler /wp-admin/tools.php?page=WPTogglerAdmin8282.0622.6428.06

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wptoggler/includes/main.php:65
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wptoggler/includes/main.php:65
    • > PHP Fatal error
      Uncaught Error: Class 'WPToggler' not found in wp-content/plugins/wptoggler/includes/admin.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
1 plugin tags: toggle

wptoggler/WPToggler.php 92% from 13 tests

This is the main PHP file of "WPToggler" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wptoggler.php" instead of "WPToggler.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin206 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP45426179
Markdown115027

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity7.33
▷ Minimum class complexity2.00
▷ Maximum class complexity14.00
Average method complexity3.11
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods9
▷ Static methods9100.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin