84% scripts-n-styles

Code Review | Scripts n Styles

WordPress plugin Scripts n Styles scored84%from 54 tests.

About plugin

  • Plugin page: scripts-n-styles
  • Plugin version: 3.5.8
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Sep 4, 2010
  • Latest release: Jun 6, 2023
  • Number of updates: 121
  • Update frequency: every 38.5 days
  • Top authors: WraithKenny (100%)

Code review

54 tests

User reviews

29 reviews

Install metrics

30,000+ active /338,461 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.27MB] [CPU: ▼2.71ms] Passed 4 tests

An overview of server-side resources used by Scripts n Styles
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1341.71 ▼0.23
Dashboard /wp-admin3.86 ▲0.5553.92 ▼5.22
Posts /wp-admin/edit.php3.75 ▲0.3938.09 ▼10.15
Add New Post /wp-admin/post-new.php6.00 ▲0.11106.84 ▲11.17
Media Library /wp-admin/upload.php3.69 ▲0.4638.85 ▲4.78
Scripts n Styles /wp-admin/tools.php?page=sns3.7236.18

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 35 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
SnS_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Scripts n Styles
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.79 ▼0.601.80 ▼0.0743.27 ▼0.47
Dashboard /wp-admin2,213 ▲255.83 ▲0.94103.92 ▼17.3539.43 ▼5.15
Posts /wp-admin/edit.php2,159 ▲732.67 ▲0.6838.42 ▲1.1537.61 ▲3.29
Add New Post /wp-admin/post-new.php4,326 ▲2,80617.26 ▼5.76718.74 ▲22.84575.54 ▲514.62
Media Library /wp-admin/upload.php1,458 ▲704.80 ▲0.57100.08 ▼2.2441.67 ▼7.20
Scripts n Styles /wp-admin/tools.php?page=sns2,3274.1175.0381.84

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • SnS_options
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/scripts-n-styles/scripts-n-styles.php:99
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/scripts-n-styles/includes/class-sns-list-usage.php on line 2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/scripts-n-styles/includes/class-sns-list-usage.php on line 2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/scripts-n-styles/includes/class-sns-list-usage.php on line 2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
6 plugin tags: admin, style, javascript, code, css...

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

This is the main PHP file of "Scripts n Styles" version 3.5.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
130 characters long description:
Allows WordPress admin users the ability to add custom CSS and JavaScript directly to individual Post, Pages or custom post types.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin7,921 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript118141,3275,043
PHP123524302,147
CSS511731

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity37.33
▷ Minimum class complexity4.00
▷ Maximum class complexity106.00
Average method complexity5.34
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods100
▷ Static methods8989.00%
▷ Public methods100100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants8
▷ Global constants00.00%
▷ Class constants8100.00%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/menu.png1.37KB0.29KB▼ 78.49%
vendor/chosen/chosen-sprite.png0.63KB0.88KB0.00%
images/icon32.png1.72KB0.45KB▼ 73.85%
vendor/chosen/chosen-sprite@2x.png0.85KB0.83KB▼ 3.10%