84% xiaodu-jsdelivr

Code Review | xiaodu-jsdelivr

WordPress plugin xiaodu-jsdelivr scored84%from 54 tests.

About plugin

  • Plugin page: xiaodu-jsdelivr
  • Plugin version: 1.4.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.0
  • WordPress version: 6.3.1
  • First release: Apr 15, 2021
  • Latest release: Jun 6, 2022
  • Number of updates: 15
  • Update frequency: every 27.8 days
  • Top authors: dujiulun2006 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /2,217 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▼1.54ms] Passed 4 tests

A check of server-side resources used by xiaodu-jsdelivr
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1743.18 ▲0.22
Dashboard /wp-admin3.48 ▲0.1847.42 ▼0.27
Posts /wp-admin/edit.php3.60 ▲0.2448.37 ▲0.36
Add New Post /wp-admin/post-new.php6.06 ▲0.1889.18 ▼6.47
Media Library /wp-admin/upload.php3.41 ▲0.1843.81 ▲5.97
xiaodu-jsdelivr /wp-admin/options-general.php?page=xiaodu_jsdelivr3.3736.69

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

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

Browser metrics Passed 4 tests

xiaodu-jsdelivr: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.24 ▼0.031.75 ▼0.3639.36 ▼7.85
Dashboard /wp-admin2,199 ▲195.62 ▲0.0990.12 ▼19.7637.55 ▼7.30
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0137.49 ▼1.7339.63 ▲1.78
Add New Post /wp-admin/post-new.php1,529 ▲323.00 ▲0.13610.01 ▼38.8552.70 ▼9.01
Media Library /wp-admin/upload.php1,407 ▲104.23 ▲0.02105.94 ▲2.8545.52 ▲1.23
xiaodu-jsdelivr /wp-admin/options-general.php?page=xiaodu_jsdelivr1,0422.1224.3032.47

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 5× PHP files output text when accessed directly:
    • > /wp-content/plugins/xiaodu-jsdelivr/inc/class-options.php
    • > /wp-content/plugins/xiaodu-jsdelivr/replacer.php
    • > /wp-content/plugins/xiaodu-jsdelivr/xiaodu-jsdelivr.php
    • > /wp-content/plugins/xiaodu-jsdelivr/options-page.php
    • > /wp-content/plugins/xiaodu-jsdelivr/scanner.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

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
3 plugin tags: jsdelivr, cdn, static

xiaodu-jsdelivr/xiaodu-jsdelivr.php Passed 13 tests

This is the main PHP file of "xiaodu-jsdelivr" version 1.4.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
47 characters long description:
Scan and serve static files from jsDelivr CDN .

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,166 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP51252191,166

PHP code Passed 2 tests

This is a short overview 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.40
Average class complexity18.00
▷ Minimum class complexity18.00
▷ Maximum class complexity18.00
Average method complexity5.25
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods125.00%
▷ Public methods375.00%
▷ Protected methods00.00%
▷ Private methods125.00%
Functions34
▷ Named functions34100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin