84% wp-cdn-rewrite

Code Review | WP CDN Rewrite

WordPress plugin WP CDN Rewrite scored84%from 54 tests.

About plugin

  • Plugin page: wp-cdn-rewrite
  • Plugin version: 0.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.5
  • WordPress version: 6.3.1
  • First release: Jan 7, 2014
  • Latest release: Sep 27, 2016
  • Number of updates: 19
  • Update frequency: every 53.9 days
  • Top authors: smccafferty (36.84%)csloisel (36.84%)kevinlangleyjr (36.84%)

Code review

54 tests

User reviews

9 reviews

Install metrics

300+ active /19,335 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.20MB] [CPU: ▼17.86ms] Passed 4 tests

This is a short check of server-side resources used by WP CDN Rewrite
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2039.78 ▼3.82
Dashboard /wp-admin3.55 ▲0.2450.54 ▼10.94
Posts /wp-admin/edit.php3.60 ▲0.2451.16 ▼10.12
Add New Post /wp-admin/post-new.php6.07 ▲0.1886.26 ▼46.54
Media Library /wp-admin/upload.php3.41 ▲0.1837.95 ▼0.56
CDN Rewrite /wp-admin/options-general.php?page=cdn_general-page3.3831.59

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 16 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
cdn_general
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for WP CDN Rewrite
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲8613.25 ▼1.181.92 ▲0.0642.05 ▼6.77
Dashboard /wp-admin2,207 ▲225.81 ▼0.0799.38 ▼20.7239.65 ▼9.83
Posts /wp-admin/edit.php2,095 ▲62.00 ▼0.0239.74 ▼4.9136.39 ▼2.69
Add New Post /wp-admin/post-new.php1,539 ▲123.15 ▼0.00582.34 ▼136.0959.66 ▼4.84
Media Library /wp-admin/upload.php1,398 ▲104.19 ▼0.0295.13 ▲1.6643.22 ▼0.01
CDN Rewrite /wp-admin/options-general.php?page=cdn_general-page8722.0323.8828.62

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • cdn_general
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 | 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
Please take a closer look at the following
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-cdn-rewrite/wp-cdn-rewrite-core.php:232
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-cdn-rewrite/wp-cdn-rewrite-core.php:232
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-cdn-rewrite/wp-cdn-rewrite-core.php:232

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: cdn, rewrite

wp-cdn-rewrite/wp-cdn-rewrite.php Passed 13 tests

The main PHP script in "WP CDN Rewrite" version 0.4.0 is automatically included on every request by WordPress
26 characters long description:
Rewrites asset URLs to CDN

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin866 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP13182312829
JSON10037

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity14.22
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.84
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods65
▷ Static methods46.15%
▷ Public methods5990.77%
▷ Protected methods00.00%
▷ Private methods69.23%
Functions17
▷ Named functions1482.35%
▷ Anonymous functions317.65%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin