90% mxp-pchome2wp

Code Review | PChome 新聞台搬家匯入工具

WordPress plugin PChome 新聞台搬家匯入工具 scored90%from 54 tests.

About plugin

  • Plugin page: mxp-pchome2wp
  • Plugin version: 1.0.7
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: Nov 15, 2017
  • Latest release: Mar 21, 2023
  • Number of updates: 12
  • Update frequency: every 163.7 days
  • Top authors: mxp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /944 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
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.82ms] Passed 4 tests

An overview of server-side resources used by PChome 新聞台搬家匯入工具
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.45 ▼0.56
Dashboard /wp-admin3.32 ▲0.0148.12 ▼7.24
Posts /wp-admin/edit.php3.37 ▲0.0148.66 ▼4.88
Add New Post /wp-admin/post-new.php5.92 ▲0.0386.40 ▼10.61
Media Library /wp-admin/upload.php3.24 ▲0.0138.22 ▲0.17
PChome 文章匯入工具設定 /wp-admin/admin.php?page=mxp-pchome2wp3.3037.95
文章匯入工具 /wp-admin/admin.php?page=mxp-pchome2wp-options3.2533.29

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: 10 new files
Database: 1 new table, 7 new options
New tables
wp_mxp_pchome_post_log
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
mxp_pchome2wp_db_version
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by PChome 新聞台搬家匯入工具
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,852 ▲10613.62 ▼0.941.99 ▲0.1141.81 ▼3.42
Dashboard /wp-admin2,236 ▲454.86 ▼0.12104.33 ▲0.1945.50 ▼0.47
Posts /wp-admin/edit.php2,116 ▲272.04 ▲0.0335.48 ▼5.3240.40 ▲3.07
Add New Post /wp-admin/post-new.php1,542 ▲2123.26 ▲0.05716.23 ▲63.7071.55 ▲10.47
Media Library /wp-admin/upload.php1,415 ▲274.29 ▲0.04105.04 ▼11.7954.12 ▲5.78
PChome 文章匯入工具設定 /wp-admin/admin.php?page=mxp-pchome2wp1,0041.8624.02101.33
文章匯入工具 /wp-admin/admin.php?page=mxp-pchome2wp-options6851.357.2438.18

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests Passed 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)
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: mxptw, pchome2wp, pchome

mxp-pchome2wp/index.php 92% from 13 tests

The main PHP script in "PChome 新聞台搬家匯入工具" version 1.0.7 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("mxp-pchome2wp.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin891 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP73654843
JavaScript11048

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity37.50
▷ Minimum class complexity6.00
▷ Maximum class complexity69.00
Average method complexity3.41
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods33
▷ Static methods1442.42%
▷ Public methods2987.88%
▷ Protected methods00.00%
▷ Private methods412.12%
Functions6
▷ Named functions00.00%
▷ Anonymous functions6100.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin