78% wp2wb

Code Review | WordPres 同步微博

WordPress plugin WordPres 同步微博 scored 78% from 54 tests.

About plugin

  • Plugin page: wp2wb
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.1
  • WordPress version: 6.3.1
  • First release: Dec 16, 2017
  • Latest release: Feb 23, 2019
  • Number of updates: 19
  • Update frequency: every 22.9 days
  • Top authors: iiiryan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 5,425 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

Server-side resources used by WordPres 同步微博
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.17 ▼4.96
Dashboard /wp-admin3.32 ▲0.0244.65 ▼5.02
Posts /wp-admin/edit.php3.37 ▲0.0147.93 ▲0.54
Add New Post /wp-admin/post-new.php5.90 ▲0.0183.33 ▼21.79
Media Library /wp-admin/upload.php3.24 ▲0.0134.77 ▼0.35
Sync to Weibo /wp-admin/options-general.php?page=wp2wb-options3.2130.78

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 14 new options
New WordPress options
wp2wb_weibo_type
wp2wb_app_secret
wp2wb_create_at
wp2wb_update_sync
can_compress_scripts
wp2wb_access_token
db_upgraded
wp2wb_app_key
widget_recent-comments
wp2wb_sync
...

Browser metrics Passed 4 tests

Checking browser requirements for WordPres 同步微博
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.25 ▼1.134.58 ▲2.4840.18 ▼10.86
Dashboard /wp-admin2,207 ▲195.79 ▲0.92104.78 ▼6.8638.38 ▼3.68
Posts /wp-admin/edit.php2,096 ▲102.01 ▼0.0640.34 ▲1.8334.57 ▲0.85
Add New Post /wp-admin/post-new.php1,545 ▲318.33 ▲0.06625.89 ▲23.6359.40 ▲8.59
Media Library /wp-admin/upload.php1,392 ▲74.31 ▲0.0695.64 ▼1.2642.19 ▼2.58
Sync to Weibo /wp-admin/options-general.php?page=wp2wb-options9291.8826.9026.17

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% 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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp2wb/sync.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp2wb/sync.php:11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=wp2wb-options
    • > Network (severe)
    https://img.iiiryan.com/donate/donate-pay.png - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/options-general.php?page=wp2wb-options
    • > Network (severe)
    https://img.iiiryan.com/donate/donate-paypal.png - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Requires php: The plugin version is formatted incorrectly
  • Plugin Name: Please specify the plugin name on the first line ( === wp2wb === )
The official readme.txt is a good inspiration

wp2wb/wp2wb.php 92% from 13 tests

Analyzing the main PHP file in "WordPres 同步微博" version 1.1.0
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 295 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected542 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP24744422
PO File13542120

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
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%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin