84% shortcode-toggle

Code Review | Shortcode Toggle

WordPress plugin Shortcode Toggle scored84%from 54 tests.

About plugin

  • Plugin page: shortcode-toggle
  • Plugin version: 1.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.8
  • WordPress version: 6.3.1
  • First release: Mar 8, 2014
  • Latest release: Mar 10, 2014
  • Number of updates: 21
  • Update frequency: every 0.1 days
  • Top authors: eflyjason (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

200+ active /4,960 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼10.16ms] Passed 4 tests

An overview of server-side resources used by Shortcode Toggle
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0143.49 ▼0.53
Dashboard /wp-admin3.31 ▼0.0347.63 ▼19.71
Posts /wp-admin/edit.php3.36 ▲0.0148.54 ▲1.66
Add New Post /wp-admin/post-new.php5.91 ▲0.0384.55 ▼15.78
Media Library /wp-admin/upload.php3.24 ▲0.0136.35 ▼4.62
Shortcode Toggle /wp-admin/tools.php?page=shortcode-toggle-help3.2030.84

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Shortcode Toggle
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,906 ▲14513.98 ▼0.779.01 ▲6.9540.82 ▲2.42
Dashboard /wp-admin2,229 ▲265.87 ▼0.02100.96 ▼11.5138.78 ▼6.01
Posts /wp-admin/edit.php2,111 ▲112.02 ▲0.0341.26 ▲4.7034.27 ▼1.48
Add New Post /wp-admin/post-new.php1,533 ▲223.07 ▼0.11676.89 ▲23.9366.16 ▲15.01
Media Library /wp-admin/upload.php1,408 ▲114.25 ▲0.0597.24 ▼21.1446.43 ▼2.82
Shortcode Toggle /wp-admin/tools.php?page=shortcode-toggle-help8002.0724.9630.16

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/shortcode-toggle/shortcode-toggle.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/shortcode-toggle/help.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: toggle, shortcode, menu

shortcode-toggle/shortcode-toggle.php Passed 13 tests

The primary PHP file in "Shortcode Toggle" version 1.0.9 is used by WordPress to initiate all plugin functionality
56 characters long description:
Add Useful Toggle Menu to your blog simply by shortcode.

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
Success! There were no dangerous files found in this plugin161 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PO File2141462
PHP2162560
CSS20031
JavaScript2008

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.00
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/minus.png0.47KB0.36KB▼ 23.71%
img/plus.png0.79KB0.64KB▼ 18.92%