84% blog-optimize

Code Review | 博客优化

WordPress plugin 博客优化 scored 84% from 54 tests.

About plugin

  • Plugin page: blog-optimize
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.3
  • WordPress version: 6.3.1
  • First release: Aug 11, 2015
  • Latest release: Mar 18, 2018
  • Number of updates: 6
  • Update frequency: every 158.5 days
  • Top authors: smyx (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 5,738 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.07MB] [CPU: ▼1.98ms] Passed 4 tests

A check of server-side resources used by 博客优化
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0740.68 ▲3.30
Dashboard /wp-admin3.38 ▲0.0757.32 ▲8.46
Posts /wp-admin/edit.php3.43 ▲0.0746.40 ▼3.12
Add New Post /wp-admin/post-new.php5.96 ▲0.0785.52 ▼6.11
Media Library /wp-admin/upload.php3.30 ▲0.0735.25 ▼1.97

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

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

Browser metrics Passed 4 tests

Checking browser requirements for 博客优化
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲8113.28 ▼1.372.88 ▲1.2544.77 ▲4.12
Dashboard /wp-admin2,222 ▲346.00 ▲1.11100.88 ▼5.8040.31 ▼0.20
Posts /wp-admin/edit.php2,102 ▲132.05 ▲0.0136.80 ▲2.1840.83 ▲5.13
Add New Post /wp-admin/post-new.php1,527 ▼117.42 ▼0.89670.42 ▲50.9554.05 ▲4.41
Media Library /wp-admin/upload.php1,401 ▲134.23 ▼0.0595.79 ▼31.7148.96 ▼4.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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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 | 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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/blog-optimize/blog-optimize.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === blog-optimize === )
You can look at the official readme.txt

blog-optimize/blog-optimize.php Passed 13 tests

The main PHP file in "博客优化" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
134 characters long description:
WordPress优化、功能增强、使用SMTP发邮件、CDN加速、站点地图(sitemap,包括移动sitemap)、数据库清理等。

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin1,211 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript3124577
PHP1510526
CSS100108

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/wp_admin_map.png7.70KB3.27KB▼ 57.51%
images/wp_admin_icon_map.png2.07KB1.00KB▼ 51.63%
images/on_off_slide.png1.30KB1.86KB0.00%
images/checkbox-switch-on.png4.85KB1.99KB▼ 58.93%
images/check-off.png0.64KB0.72KB0.00%