84% spoiler-alert-js

Code Review | Spoiler alert JS

WordPress plugin Spoiler alert JS scored84%from 54 tests.

About plugin

  • Plugin page: spoiler-alert-js
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.1-4.3.1
  • WordPress version: 6.3.1
  • First release: Oct 23, 2015
  • Latest release: Oct 23, 2015
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: lucdlb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,420 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.74ms] Passed 4 tests

Server-side resources used by Spoiler alert JS
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0144.00 ▲2.17
Dashboard /wp-admin3.32 ▲0.0148.72 ▼4.00
Posts /wp-admin/edit.php3.37 ▲0.0151.12 ▼4.01
Add New Post /wp-admin/post-new.php5.90 ▲0.0182.99 ▼21.10
Media Library /wp-admin/upload.php3.24 ▲0.0142.21 ▲7.05

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Spoiler alert JS
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲13713.50 ▼0.808.41 ▲6.3445.00 ▼4.66
Dashboard /wp-admin2,206 ▲155.85 ▼0.04103.07 ▼2.6141.41 ▼3.07
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.1434.02 ▼7.6934.78 ▼1.45
Add New Post /wp-admin/post-new.php1,519 ▼023.22 ▼0.08690.37 ▲22.3850.91 ▼2.75
Media Library /wp-admin/upload.php1,391 ▲34.12 ▼0.18103.53 ▼0.4747.10 ▼6.28

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/spoiler-alert-js/spoiler-alert-js.php:41

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: alert, spoiler, javascript, blur

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

The main PHP script in "Spoiler alert JS" version 1.0 is automatically included on every request by WordPress
115 characters long description:
Add a blur on spoiler alerts ; based on Joshua Hull's spoiler-alert JS (https://github.com/joshbuddy/spoiler-alert)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin51 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1234750
JavaScript1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods466.67%
▷ Protected methods00.00%
▷ Private methods233.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin