89% page-specific-scripts

Code Review | Page Specific Scripts

WordPress plugin Page Specific Scripts scored89%from 54 tests.

About plugin

  • Plugin page: page-specific-scr...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.5.1
  • WordPress version: 6.3.1
  • First release: Jul 3, 2019
  • Latest release: Sep 30, 2020
  • Number of updates: 6
  • Update frequency: every 77.0 days
  • Top authors: affuxo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /2,437 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼8.50ms] Passed 4 tests

An overview of server-side resources used by Page Specific Scripts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.00 ▲0.70
Dashboard /wp-admin3.33 ▼0.0148.67 ▼17.21
Posts /wp-admin/edit.php3.38 ▲0.0347.03 ▼4.34
Add New Post /wp-admin/post-new.php5.92 ▲0.0386.64 ▼13.14
Media Library /wp-admin/upload.php3.26 ▲0.0339.00 ▲1.99

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Page Specific Scripts
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲11214.48 ▲0.101.98 ▼0.3342.44 ▼14.38
Dashboard /wp-admin2,224 ▲185.88 ▲0.96107.01 ▲3.3943.04 ▲2.59
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0133.99 ▼7.3133.77 ▼1.90
Add New Post /wp-admin/post-new.php6,247 ▲4,72119.03 ▲1.39948.18 ▲339.6158.01 ▲5.91
Media Library /wp-admin/upload.php1,400 ▼34.27 ▲0.03113.42 ▲12.0547.88 ▼1.08

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Donate link: Invalid url: "N/A"
  • Screenshots: Please add an image for screenshot #1 (Add your scripts)
You can look at the official readme.txt

page-specific-scripts/wpcp-page-specific-scripts.php 85% from 13 tests

"Page Specific Scripts" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("page-specific-scripts.php" instead of "wpcp-page-specific-scripts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected166 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP33223166

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity3.11
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
cover image.png69.61KB32.67KB▼ 53.07%