84% wp-spoiler-alert

Code Review | wp-spoiler-alert

WordPress plugin wp-spoiler-alert scored84%from 54 tests.

About plugin

  • Plugin page: wp-spoiler-alert
  • Plugin version: 0.8.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-3.9.2
  • WordPress version: 6.3.1
  • First release: May 8, 2014
  • Latest release: Aug 7, 2014
  • Number of updates: 54
  • Update frequency: every 1.7 days
  • Top authors: dsawardekar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,028 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.47MB] [CPU: ▼7.60ms] Passed 4 tests

An overview of server-side resources used by wp-spoiler-alert
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4343.29 ▲2.88
Dashboard /wp-admin3.80 ▲0.4653.60 ▼16.94
Posts /wp-admin/edit.php3.85 ▲0.4950.85 ▼4.82
Add New Post /wp-admin/post-new.php6.38 ▲0.5098.35 ▼11.53
Media Library /wp-admin/upload.php3.72 ▲0.5041.51 ▲6.00
WP Spoiler Alert /wp-admin/options-general.php?page=wp-spoiler-alert3.6341.19

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 235 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by wp-spoiler-alert
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7313.22 ▼1.411.68 ▼0.0346.81 ▲0.36
Dashboard /wp-admin2,228 ▲254.82 ▼0.08113.25 ▲4.3844.93 ▲1.07
Posts /wp-admin/edit.php2,083 ▼142.06 ▲0.0536.64 ▼2.2338.23 ▲4.09
Add New Post /wp-admin/post-new.php1,543 ▼523.18 ▲0.14620.28 ▼9.7180.99 ▲3.23
Media Library /wp-admin/upload.php1,404 ▲44.24 ▼0.0199.57 ▼10.5743.57 ▼6.47
WP Spoiler Alert /wp-admin/options-general.php?page=wp-spoiler-alert8762.9861.9031.02

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

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)
Even though everything seems fine, this is not an exhaustive test

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
Please fix the following items
  • 141× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression' not found in wp-content/plugins/wp-spoiler-alert/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression' not found in wp-content/plugins/wp-spoiler-alert/vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression' not found in wp-content/plugins/wp-spoiler-alert/vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/wp-spoiler-alert/vendor/twig/twig/lib/Twig/TokenParser/If.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/wp-spoiler-alert/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Matches.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Arrow\\Asset\\Manifest' not found in wp-content/plugins/wp-spoiler-alert/lib/WpSpoilerAlert/FrontEndManifest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/wp-spoiler-alert/vendor/twig/twig/lib/Twig/Node/SetTemp.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/wp-spoiler-alert/vendor/twig/twig/lib/Twig/Node/Module.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/wp-spoiler-alert/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/wp-spoiler-alert/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (Screenshot 1), #2 (Screenshot 2)
You can take inspiration from this readme.txt

wp-spoiler-alert/wp-spoiler-alert.php Passed 13 tests

The main PHP file in "wp-spoiler-alert" ver. 0.8.3 adds more information about the plugin and also serves as the entry point for this plugin
40 characters long description:
Shortcode to hide Spoilers in your Posts

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin23,178 lines of code in 227 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript62,7817,90011,839
PHP2172,6765,12011,063
JSON100248
CSS24016
HTML10012

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity6.86
▷ Minimum class complexity1.00
▷ Maximum class complexity116.00
Average method complexity2.13
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces9
Interfaces20
Traits0
Classes193
▷ Abstract classes105.18%
▷ Concrete classes18394.82%
▷ Final classes00.00%
Methods1,140
▷ Static methods161.40%
▷ Public methods1,03090.35%
▷ Protected methods1089.47%
▷ Private methods20.18%
Functions52
▷ Named functions5198.08%
▷ Anonymous functions11.92%
Constants38
▷ Global constants12.63%
▷ Class constants3797.37%
▷ Public constants37100.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
There are no PNG files in this plugin