84% disable-styles-scripts

Code Review | Disable Styles & Scripts

WordPress plugin Disable Styles & Scripts scored84%from 54 tests.

About plugin

  • Plugin page: disable-styles-sc...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 1.0.0-4.0
  • WordPress version: 6.3.1
  • First release: Oct 29, 2014
  • Latest release: Oct 29, 2014
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: lpeharda (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

60+ active /1,648 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
Install script ran successfully

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

Analyzing server-side resources used by Disable Styles & Scripts
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.55 ▼2.00
Dashboard /wp-admin3.33 ▼0.0143.62 ▼16.99
Posts /wp-admin/edit.php3.38 ▲0.0347.80 ▼1.72
Add New Post /wp-admin/post-new.php5.91 ▲0.0378.21 ▼21.16
Media Library /wp-admin/upload.php3.25 ▲0.0336.09 ▲0.45
Disable S&S /wp-admin/options-general.php?page=disable-styles-scripts3.2331.11

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Disable Styles & Scripts
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3313.66 ▼0.871.71 ▼0.2843.17 ▲4.81
Dashboard /wp-admin2,210 ▲254.88 ▼0.98110.45 ▲10.7539.12 ▼2.86
Posts /wp-admin/edit.php2,093 ▲42.03 ▼0.0140.28 ▼0.4635.63 ▼1.21
Add New Post /wp-admin/post-new.php1,536 ▲1720.93 ▼2.28649.38 ▼27.6660.36 ▼1.10
Media Library /wp-admin/upload.php1,392 ▲74.21 ▲0.0195.18 ▼38.1643.38 ▼6.14
Disable S&S /wp-admin/options-general.php?page=disable-styles-scripts8802.1922.2931.12

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

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
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/disable-styles-scripts/disable-styles-scripts.php:227
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/disable-styles-scripts/views/admin.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === disable-styles-scripts === )
The official readme.txt is a good inspiration

disable-styles-scripts/disable-styles-scripts.php Passed 13 tests

"Disable Styles & Scripts" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
98 characters long description:
Disable selected plugin (and/or theme) styles and scripts. Set conditions which will be evaluated.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected191 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP32386191

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity32.00
▷ Minimum class complexity32.00
▷ Maximum class complexity32.00
Average method complexity5.43
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods114.29%
▷ Public methods685.71%
▷ Protected methods114.29%
▷ Private methods00.00%
Functions0
▷ Named functions00.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.15MB with 0.11MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png158.55KB44.33KB▼ 72.04%