74% sync-wechat

Code Review | Sync Wechat

WordPress plugin Sync Wechat scored74%from 54 tests.

About plugin

  • Plugin page: sync-wechat
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8.1
  • WordPress version: 6.3.1
  • First release: Nov 22, 2021
  • Latest release: Dec 12, 2021
  • Number of updates: 6
  • Update frequency: every 3.7 days
  • Top authors: hsfs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /489 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼1.90MB] [CPU: ▼56.77ms] Passed 4 tests

An overview of server-side resources used by Sync Wechat
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.365.19 ▼32.79
Dashboard /wp-admin2.12 ▼1.226.69 ▼54.25
Posts /wp-admin/edit.php2.12 ▼1.236.92 ▼39.72
Add New Post /wp-admin/post-new.php2.12 ▼3.765.92 ▼100.30
Media Library /wp-admin/upload.php2.12 ▼1.116.44 ▼29.68

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 19 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
sync_wechat_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Sync Wechat
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,877 ▲13113.24 ▼0.983.41 ▲1.5138.64 ▼5.67
Dashboard /wp-admin2,236 ▲514.98 ▲0.0798.18 ▼22.8342.91 ▼3.15
Posts /wp-admin/edit.php2,127 ▲382.32 ▲0.2638.54 ▲0.7939.22 ▲7.10
Add New Post /wp-admin/post-new.php1,541 ▲617.75 ▼5.39673.36 ▲1.7739.73 ▼11.52
Media Library /wp-admin/upload.php1,423 ▲324.35 ▲0.11105.15 ▲4.2048.48 ▲5.02

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the daterangepicker handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options detected upon uninstall: 7 options
    • sync_wechat_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/sync-wechat/xync.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sync-wechat/dashboard.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
1 plugin tags: sync tool

sync-wechat/xync.php 92% from 13 tests

The primary PHP file in "Sync Wechat" version 1.0.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("sync-wechat.php" instead of "xync.php")

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
Everything looks great! No dangerous files found in this plugin896 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP68664539
CSS2721354
JavaScript20123

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity8.67
▷ Minimum class complexity2.00
▷ Maximum class complexity19.00
Average method complexity3.30
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods981.82%
▷ Protected methods00.00%
▷ Private methods218.18%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
6 PNG files occupy 0.64MB with 0.35MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png21.73KB10.50KB▼ 51.68%
assets/icon-128x128.png8.88KB4.57KB▼ 48.52%
images/ok.png7.60KB4.50KB▼ 40.80%
assets/banner-1544x500.png429.88KB164.45KB▼ 61.75%
assets/banner-772x250.png173.97KB57.53KB▼ 66.93%