78% wp-cdnjs

Code Review | WP cdnjs

WordPress plugin WP cdnjs scored78%from 54 tests.

About plugin

  • Plugin page: wp-cdnjs
  • Plugin version: 0.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.3
  • WordPress version: 6.3.1
  • First release: Aug 8, 2014
  • Latest release: Mar 20, 2020
  • Number of updates: 29
  • Update frequency: every 70.7 days
  • Top authors: audioscavenger (51.72%)mindshare (51.72%)

Code review

54 tests

User reviews

3 reviews

Install metrics

90+ active /5,143 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼6.83ms] Passed 4 tests

Analyzing server-side resources used by WP cdnjs
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0546.85 ▼6.72
Dashboard /wp-admin3.34 ▲0.0449.82 ▼2.05
Posts /wp-admin/edit.php3.46 ▲0.1047.56 ▼5.87
Add New Post /wp-admin/post-new.php5.94 ▲0.0689.88 ▼12.67
Media Library /wp-admin/upload.php3.27 ▲0.0447.08 ▲12.65
WP cdnjs /wp-admin/options-general.php?page=wp-cdnjs3.2332.13

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for WP cdnjs
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲4814.80 ▲0.421.95 ▲0.0945.13 ▲4.36
Dashboard /wp-admin2,215 ▲385.72 ▲0.0892.81 ▲3.9365.23 ▲25.27
Posts /wp-admin/edit.php2,122 ▲252.30 ▲0.3133.84 ▼3.0235.58 ▼0.43
Add New Post /wp-admin/post-new.php1,578 ▲5224.31 ▲1.13719.17 ▲28.6267.99 ▲10.64
Media Library /wp-admin/upload.php1,417 ▲144.45 ▲0.25114.82 ▲13.7476.95 ▲34.95
WP cdnjs /wp-admin/options-general.php?page=wp-cdnjs1,0042.0939.3029.53

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-cdnjs/views/wp-cdnjs-settings.php:4

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=wp-cdnjs
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wp-cdnjs/assets/js/wp-cdnjs.js?ver=1584672338:108:34)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=wp-cdnjs
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: cloudflare, cdnjs, libraries, css, js...

wp-cdnjs/wp-cdnjs.php 92% from 13 tests

The main PHP script in "WP cdnjs" version 0.4.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 151 characters long)

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 plugin1,181 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP4140389675
JavaScript145102295
PO File27480184
CSS17327

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity42.50
▷ Minimum class complexity26.00
▷ Maximum class complexity59.00
Average method complexity3.13
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods39
▷ Static methods00.00%
▷ Public methods3794.87%
▷ Protected methods00.00%
▷ Private methods25.13%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/menu-icon.png0.20KB0.20KB0.00%