84% addscript

Code Review | Add Script

WordPress plugin Add Script scored 84% from 54 tests.

About plugin

  • Plugin page: addscript
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.9
  • WordPress version: 6.3.1
  • First release: Jun 23, 2017
  • Latest release: Nov 21, 2017
  • Number of updates: 15
  • Update frequency: every 10.1 days
  • Top authors: tresrl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,030 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

An overview of server-side resources used by Add Script
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0251.19 ▲10.73
Dashboard /wp-admin3.34 ▲0.0446.39 ▼6.93
Posts /wp-admin/edit.php3.46 ▲0.1050.46 ▲3.34
Add New Post /wp-admin/post-new.php5.92 ▲0.0483.50 ▼12.93
Media Library /wp-admin/upload.php3.27 ▲0.0437.52 ▲4.00
AddScript /wp-admin/options-general.php?page=addscript-settings3.2333.56

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Add Script
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.22 ▼1.021.70 ▲0.1043.42 ▼6.90
Dashboard /wp-admin2,207 ▲225.81 ▼0.09105.73 ▼0.8839.62 ▼0.32
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0338.93 ▲0.0434.87 ▼1.37
Add New Post /wp-admin/post-new.php1,537 ▲923.34 ▲5.23654.68 ▲55.4564.05 ▲0.58
Media Library /wp-admin/upload.php1,392 ▲44.21 ▼0.0396.76 ▼2.0445.47 ▲4.20
AddScript /wp-admin/options-general.php?page=addscript-settings7992.0224.4125.80

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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Addscript\\Base' not found in wp-content/plugins/addscript/src/Addscript/Admin.php:14
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/addscript/views/admin/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Addscript\\Base' not found in wp-content/plugins/addscript/src/Addscript/Frontend.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

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
1 plugin tags: script

addscript/addscript.php Passed 13 tests

This is the main PHP file of "Add Script" version 1.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
51 characters long description:
Simple plugin to add Google Analytics in the footer

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 plugin188 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP5184321188

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity3.00
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.30
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes133.33%
▷ Concrete classes266.67%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods840.00%
▷ Protected methods945.00%
▷ Private methods315.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin