78% magicpost

Code Review | MagicPost - WordPress文章管理功能增强插件

WordPress plugin MagicPost - WordPress文章管理功能增强插件 scored78%from 54 tests.

About plugin

  • Plugin page: magicpost
  • Plugin version: 1.1.4
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.2
  • WordPress version: 6.3.1
  • First release: May 28, 2022
  • Latest release: Jun 7, 2023
  • Number of updates: 8
  • Update frequency: every 49.0 days
  • Top authors: wbolt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /2,900 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.64MB] [CPU: ▲0.04ms] Passed 4 tests

Analyzing server-side resources used by MagicPost - WordPress文章管理功能增强插件
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.12 ▲0.6645.04 ▲0.64
Dashboard /wp-admin3.99 ▲0.6848.76 ▼3.88
Posts /wp-admin/edit.php4.04 ▲0.6850.13 ▼1.42
Add New Post /wp-admin/post-new.php6.52 ▲0.6396.56 ▲4.82
Media Library /wp-admin/upload.php3.85 ▲0.6148.78 ▲11.32

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 54 new files
Database: no new tables, 7 new options
New WordPress options
category_children
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by MagicPost - WordPress文章管理功能增强插件
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,860 ▲11413.29 ▼0.961.68 ▼0.2741.59 ▼1.28
Dashboard /wp-admin2,263 ▲755.86 ▲0.97106.91 ▼11.4583.31 ▲36.39
Posts /wp-admin/edit.php2,152 ▲632.01 ▼0.0037.31 ▼0.7841.40 ▲9.61
Add New Post /wp-admin/post-new.php6,643 ▲5,12927.67 ▲10.14960.23 ▲274.5880.27 ▲25.20
Media Library /wp-admin/upload.php1,442 ▲514.24 ▲0.0699.16 ▲0.4985.67 ▲41.16
文章翻译 /wp-admin/admin.php?page=magicpost#/translate1,5167.83150.40177.95
下载管理 /wp-admin/admin.php?page=magicpost#/download1,7228.39134.89139.49
定时发布 /wp-admin/admin.php?page=magicpost#/schedule1,8658.30127.36155.74
文章搬家 /wp-admin/admin.php?page=magicpost#/move1,7729.94134.37154.36
社交分享 /wp-admin/admin.php?page=magicpost#/share1,9018.34125.33159.90
插件设置 /wp-admin/admin.php?page=magicpost#/home1,5327.28123.51123.10
HTML清理 /wp-admin/admin.php?page=magicpost#/clean2,5009.80125.48153.07

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

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 5× PHP files output text when accessed directly:
    • > /wp-content/plugins/magicpost/inc/download_btn.php
    • > /wp-content/plugins/magicpost/inc/widget_download.php
    • > /wp-content/plugins/magicpost/index.php
    • > /wp-content/plugins/magicpost/inc/download.php
    • > /wp-content/plugins/magicpost/inc/action_dialog.php
  • 49× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: dl_info in wp-content/plugins/magicpost/inc/download.php on line 40
    • > PHP Notice
      Undefined variable: cht_cnf in wp-content/plugins/magicpost/inc/action_dialog.php on line 49
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/magicpost/inc/action_dialog.php on line 49
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/magicpost/inc/action_dialog.php on line 99
    • > PHP Warning
      in_array() expects parameter 2 to be array, null given in wp-content/plugins/magicpost/inc/meta_box.php on line 49
    • > PHP Notice
      Undefined variable: remark_info in wp-content/plugins/magicpost/inc/download.php on line 57
    • > PHP Notice
      Undefined variable: wb_dipp_type_items in wp-content/plugins/magicpost/inc/meta_box.php on line 77
    • > PHP Warning
      in_array() expects parameter 2 to be array, null given in wp-content/plugins/magicpost/inc/meta_box.php on line 42
    • > PHP Notice
      Undefined variable: need_login in wp-content/plugins/magicpost/inc/download_btn.php on line 9
    • > PHP Notice
      Undefined variable: dl_mode in wp-content/plugins/magicpost/inc/meta_box.php on line 115

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: autopost, social widget, downloader, schedule post, auto schedule...

magicpost/index.php 85% from 13 tests

The entry point to "MagicPost - WordPress文章管理功能增强插件" version 1.1.4 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 262 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("magicpost.php" instead of "index.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected4,324 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
PHP196972274,300
JavaScript1704616
CSS3034
SVG1103
HTML1001

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 136)
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity83.70
▷ Minimum class complexity5.00
▷ Maximum class complexity163.00
Average method complexity7.86
▷ Minimum method complexity1.00
▷ Maximum method complexity136.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods121
▷ Static methods3327.27%
▷ Public methods12099.17%
▷ Protected methods00.00%
▷ Private methods10.83%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 0.35MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/preview/dwq_theme_5.png135.34KB53.78KB▼ 60.26%
assets/preview/dwq_theme_3.png49.40KB49.42KB0.00%
assets/preview/dwq_theme_1.png51.46KB51.47KB0.00%
assets/img/def_cover.png0.15KB0.15KB0.00%
assets/img/bgi/theme_3.png30.07KB17.87KB▼ 40.56%