72% synchronize-wechat

Code Review | synchronize wechat

WordPress plugin synchronize wechat scored72%from 54 tests.

About plugin

  • Plugin page: synchronize-wechat
  • Plugin version: 0.9
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.9
  • WordPress version: 6.3.1
  • First release: Jan 26, 2019
  • Latest release: Apr 5, 2020
  • Number of updates: 31
  • Update frequency: every 14.1 days
  • Top authors: zhaofengshu33 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /840 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.33MB] [CPU: ▼3.79ms] Passed 4 tests

Server-side resources used by synchronize wechat
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3543.43 ▲3.44
Dashboard /wp-admin3.67 ▲0.3750.25 ▲3.01
Posts /wp-admin/edit.php3.72 ▲0.3744.74 ▼4.47
Add New Post /wp-admin/post-new.php6.19 ▲0.3182.72 ▼16.38
Media Library /wp-admin/upload.php3.53 ▲0.3136.41 ▲2.69
sync_wechat /wp-admin/edit.php?page=sync_wechat-unique-identifier3.5332.54

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

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

Browser metrics Passed 4 tests

Checking browser requirements for synchronize wechat
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.32 ▼1.054.04 ▲2.4142.83 ▼1.77
Dashboard /wp-admin2,207 ▲165.86 ▼0.0497.74 ▼6.2236.93 ▼7.40
Posts /wp-admin/edit.php2,093 ▲41.99 ▼0.0739.59 ▲4.1031.51 ▼5.79
Add New Post /wp-admin/post-new.php1,536 ▲323.24 ▲0.21681.70 ▲23.8660.13 ▲5.55
Media Library /wp-admin/upload.php1,389 ▲44.20 ▲0.0097.72 ▲0.1940.11 ▼4.11
sync_wechat /wp-admin/edit.php?page=sync_wechat-unique-identifier1,1142.1742.2227.08

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • access_token

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

SRP 0% 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
The following issues need your attention
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/synchronize-wechat/wechat-php-sdk/demo/runtime/access_token_cache.php
    • > /wp-content/plugins/synchronize-wechat/wechat-php-sdk/demo/demo-jssdk.php
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Memcached' not found in wp-content/plugins/synchronize-wechat/wechat-php-sdk/demo/snsapi/callback_snsapi_userinfo.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Memcached' not found in wp-content/plugins/synchronize-wechat/wechat-php-sdk/demo/demo_message.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Memcached' not found in wp-content/plugins/synchronize-wechat/wechat-php-sdk/demo/snsapi/callback_snsapi_base.php:24
    • > Not set saveTokenDiy method, jsapi_ticket will be refreshed each time.
    • > PHP Fatal error
      Uncaught Error: Class 'Home\\Controller\\BaseController' not found in wp-content/plugins/synchronize-wechat/wechat-php-sdk/demo/demo_thinkPHP.php:20
    • > Not set getTicketDiy method, jsapi_ticket will be refreshed each time.
    • > PHP Fatal error
      Uncaught Error: Class 'Memcached' not found in wp-content/plugins/synchronize-wechat/wechat-php-sdk/demo/snsapi/get_url_snsapi_base.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Memcached' not found in wp-content/plugins/synchronize-wechat/wechat-php-sdk/demo/index.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Memcached' not found in wp-content/plugins/synchronize-wechat/wechat-php-sdk/demo/snsapi/get_url_snsapi_userinfo.php:23

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/edit.php?page=sync_wechat-unique-identifier
    • > Network (severe)
    wp-content/plugins/synchronize-wechat/css/jquery-ui-1.13.2.min.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
1 plugin tags: wechat

synchronize-wechat/synchronize_wechat.php 92% from 13 tests

This is the main PHP file of "synchronize wechat" version 0.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("synchronize-wechat.php" instead of "synchronize_wechat.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected5,092 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP265082,4344,114
Markdown22350881
JSON20052
PO File1162144
CSS1151

PHP code Passed 2 tests

This is a very shot review 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.43
Average class complexity48.33
▷ Minimum class complexity1.00
▷ Maximum class complexity197.00
Average method complexity4.37
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods169
▷ Static methods116.51%
▷ Public methods14887.57%
▷ Protected methods169.47%
▷ Private methods52.96%
Functions47
▷ Named functions3063.83%
▷ Anonymous functions1736.17%
Constants27
▷ Global constants2488.89%
▷ Class constants311.11%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%
css/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%
css/images/ui-icons_cc0000_256x240.png4.44KB4.17KB▼ 6.02%
css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
css/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%