94% addscript

Code Review | Add Script

WordPress plugin Add Script scored 94% 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: 5.9.2
  • 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 / 831 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

A check of server-side resources used by Add Script
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0259.09 ▲6.28
Dashboard /wp-admin3.45 ▲0.0534.85 ▼5.28
Posts /wp-admin/edit.php3.68 ▲0.0438.99 ▼2.77
Add New Post /wp-admin/post-new.php6.92 ▼0.0599.61 ▼1,167.80
Media Library /wp-admin/upload.php3.33 ▲0.0427.25 ▼2.90
AddScript /wp-admin/options-general.php?page=addscript-settings3.3024.96

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Add Script
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,786 ▲4215.58 ▼0.055.89 ▼1.102.32 ▼0.18
Dashboard /wp-admin2,880 ▲226.13 ▼0.05121.75 ▼15.16155.71 ▼5.83
Posts /wp-admin/edit.php2,662 ▼323.23 ▼0.0162.70 ▲1.66137.37 ▼3.07
Add New Post /wp-admin/post-new.php1,714 ▲320.68 ▼0.90430.95 ▲2.46169.16 ▲2.80
Media Library /wp-admin/upload.php1,706 ▲85.45 ▼0.08142.55 ▼3.84188.79 ▼0.27
AddScript /wp-admin/options-general.php?page=addscript-settings1,0382.3655.01121.30

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled successfully, without leaving any zombie files or tables

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 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: Class 'Addscript\\Base' not found in wp-content/plugins/addscript/src/Addscript/Frontend.php:14
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/addscript/views/admin/settings.php:3

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 issues were found


Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
1 plugin tags: script

addscript/addscript.php Passed 13 tests

Analyzing the main PHP file in "Add Script" version 1.4
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

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
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
▷ Abstract classes133.33%
▷ Concrete classes266.67%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods840.00%
▷ Protected methods945.00%
▷ Private methods315.00%
▷ Named functions1100.00%
▷ Anonymous functions00.00%
▷ 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
There are no PNG files in this plugin