71% cdnjs

Code Review | CDNJS for WordPress

WordPress plugin CDNJS for WordPress scored 71% from 54 tests.

About plugin

  • Plugin page: cdnjs
  • Plugin version: 1.3.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.8
  • WordPress version: 6.3.1
  • First release: Dec 17, 2012
  • Latest release: Apr 25, 2017
  • Number of updates: 22
  • Update frequency: every 100.7 days
  • Top authors: paultgoodchild (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

20+ active / 8,590 total downloads

Benchmarks

Plugin footprint 81% from 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.14MB] [CPU: ▼2.29ms] 50% from 4 tests

A check of server-side resources used by CDNJS for WordPress
The following require your attention
  • RAM: The total memory usage must be kept under 10MB (currently 20.87MB on /wp-admin/admin.php?page=worpit-cdnjs-includes)
  • CPU: Try to keep total CPU usage under 500.00ms (currently 1,854.33ms on /wp-admin/admin.php?page=worpit-cdnjs-includes)
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1243.28 ▲2.86
Dashboard /wp-admin4.09 ▲0.7853.43 ▲3.47
Posts /wp-admin/edit.php3.55 ▲0.1943.93 ▲0.79
Add New Post /wp-admin/post-new.php6.02 ▲0.1384.96 ▼16.26
Media Library /wp-admin/upload.php3.36 ▲0.1340.59 ▲8.13
Dashboard /wp-admin/admin.php?page=worpit-cdnjs3.3530.85
Includes /wp-admin/admin.php?page=worpit-cdnjs-includes20.871,854.33

Server storage [IO: ▲0.24MB] [DB: ▲0.11MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 18 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
worpit_cdnjs_current_plugin_version
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics 50% from 4 tests

An overview of browser requirements for CDNJS for WordPress
A great user experience is important, so you should focus on the following
  • Nodes: You must limit the number of DOM nodes under 25,000 (currently 182,167 on /wp-admin/admin.php?page=worpit-cdnjs-includes)
  • Layout duration:Try to keep CSS layout execution time under 1,500.00ms (currently 2,501.29ms on /wp-admin/admin.php?page=worpit-cdnjs-includes)
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,955 ▲22013.23 ▼1.351.70 ▼0.3144.14 ▼2.00
Dashboard /wp-admin2,346 ▲1555.86 ▼0.05100.34 ▼19.0092.07 ▲49.43
Posts /wp-admin/edit.php2,142 ▲562.03 ▼0.0138.56 ▲2.0834.28 ▼0.35
Add New Post /wp-admin/post-new.php1,716 ▲17422.28 ▲4.11754.49 ▲127.2863.60 ▼0.08
Media Library /wp-admin/upload.php1,438 ▲534.23 ▲0.02108.27 ▲11.3778.74 ▲37.65
Dashboard /wp-admin/admin.php?page=worpit-cdnjs1,3343.6770.7465.25
Includes /wp-admin/admin.php?page=worpit-cdnjs-includes182,1676.63176.322,501.29

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/cdnjs/views/bootstrapcss_js.php
    • > /wp-content/plugins/cdnjs/views/widgets/common_widgets.php
  • 27× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Use of undefined constant WORPIT_DS - assumed 'WORPIT_DS' (this will throw an Error in a future version of PHP) in wp-content/plugins/cdnjs/views/worpit-cdnjs-includes.php on line 4
    • > PHP Notice
      Undefined variable: worpit_var_prefix in wp-content/plugins/cdnjs/views/bootstrapcss_js.php on line 52
    • > PHP Notice
      Undefined variable: worpit_var_prefix in wp-content/plugins/cdnjs/views/bootstrapcss_js.php on line 164
    • > PHP Notice
      Undefined variable: worpit_var_prefix in wp-content/plugins/cdnjs/views/bootstrapcss_js.php on line 108
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _worpit_cdnjs_e() in wp-content/plugins/cdnjs/views/worpit-cdnjs-includes.php:12
    • > PHP Notice
      Undefined variable: worpit_var_prefix in wp-content/plugins/cdnjs/views/bootstrapcss_js.php on line 157
    • > PHP Notice
      Undefined variable: worpit_var_prefix in wp-content/plugins/cdnjs/views/bootstrapcss_js.php on line 154
    • > PHP Notice
      Undefined variable: worpit_var_prefix in wp-content/plugins/cdnjs/views/bootstrapcss_js.php on line 95
    • > PHP Notice
      Undefined variable: worpit_var_prefix in wp-content/plugins/cdnjs/views/bootstrapcss_js.php on line 6
    • > PHP Notice
      Undefined variable: worpit_var_prefix in wp-content/plugins/cdnjs/views/bootstrapcss_js.php on line 153

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=worpit-cdnjs
    • > Security (warning) in unknown
    https://www.icontrolwp.com/custom/remote/plugins/hlt-bootstrapcss-plugin-widgets.php?page=worpit-cdnjs&snippet=dashboard-widget-developerchannel 102 Mixed Content: The page at 'https://www.icontrolwp.com/custom/remote/plugins/hlt-bootstrapcss-plugin-widgets.php?page=worpit-cdnjs&snippet=dashboard-widget-developerchannel' was loaded over a secure connection, but contains a form that targets an insecure endpoint 'http://www.hostliketoast.com/dap/signup_submit.php'. This endpoint should be made available over a secure connection.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === cdnjs === )
Please take inspiration from this readme.txt

cdnjs/worpit-cdnjs-main.php 92% from 13 tests

"CDNJS for WordPress" version 1.3.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("cdnjs.php" instead of "worpit-cdnjs-main.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
Good job! No executable or dangerous file extensions detected6,058 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
CSS3926254,983
PHP92941821,075

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity30.67
▷ Minimum class complexity6.00
▷ Maximum class complexity48.00
Average method complexity2.35
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods66
▷ Static methods710.61%
▷ Public methods3146.97%
▷ Protected methods3350.00%
▷ Private methods23.03%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants18.33%
▷ Class constants1191.67%
▷ Public constants11100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/images/worpit_24x24.png2.32KB1.29KB▼ 44.23%
resources/images/worpit_16x16.png1.72KB0.76KB▼ 56.01%
resources/images/bright_squares.png40.67KB43.76KB0.00%
resources/images/worpit_32x32.png3.03KB1.53KB▼ 49.61%