10% a-synchronization

Code Review | A Synchronization

WordPress plugin A Synchronization scored10%from 54 tests.

About plugin

  • Plugin page: a-synchronization
  • Plugin version: 1.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.0
  • WordPress version: 6.3.1
  • First release: Apr 18, 2019
  • Latest release: Apr 25, 2019
  • Number of updates: 4
  • Update frequency: every 1.8 days
  • Top authors: e5201 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /691 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/a-synchronization/includes/setting.php+20
    Use of undefined constant AWECHAT_PLUGIN_OPTIONNAME - assumed 'AWECHAT_PLUGIN_OPTIONNAME' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼0.70MB] [CPU: ▼20.15ms] Passed 4 tests

A check of server-side resources used by A Synchronization
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0337.50 ▼9.07
Dashboard /wp-admin3.33 ▲0.0346.27 ▼7.33
Posts /wp-admin/edit.php3.30 ▼0.0642.77 ▼2.73
Add New Post /wp-admin/post-new.php3.11 ▼2.7736.42 ▼60.87
Media Library /wp-admin/upload.php3.25 ▲0.0233.11 ▼3.32
Async Settings /wp-admin/options-general.php?page=Async_setting3.1929.17

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 66 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
Async_setting
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for A Synchronization
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.36 ▼1.204.37 ▲2.5039.97 ▼4.53
Dashboard /wp-admin2,207 ▲195.79 ▲0.8996.50 ▼2.8140.32 ▼1.90
Posts /wp-admin/edit.php2,103 ▲141.99 ▲0.0040.66 ▲3.7635.78 ▲5.30
Add New Post /wp-admin/post-new.php6,242 ▲4,72825.89 ▲8.40800.25 ▲110.6954.62 ▼8.27
Media Library /wp-admin/upload.php1,392 ▲104.25 ▼0.0394.00 ▼5.6239.99 ▼7.75
Async Settings /wp-admin/options-general.php?page=Async_setting1,1023.0342.4065.23

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • Async_setting
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=Async_setting
    • > Notice in wp-content/plugins/a-synchronization/includes/setting.php+51
    Undefined index: token
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=Async_setting
    • > Notice in wp-content/plugins/a-synchronization/includes/setting.php+92
    Undefined index: ximalaya
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=Async_setting
    • > Notice in wp-content/plugins/a-synchronization/includes/setting.php+92
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/options-general.php?page=Async_setting
    • > Notice in wp-content/plugins/a-synchronization/includes/setting.php+105
    Undefined index: xmlrpc_sync_ximalaya
    • > GET request to /wp-admin/options-general.php?page=Async_setting
    • > Notice in wp-content/plugins/a-synchronization/includes/setting.php+121
    Undefined index: title_prefix

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 items
  • 15× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/a-synchronization/vendor/paquettg/string-encode/tests/EncodeTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPHtmlParser\\Dom\\AbstractNode' not found in wp-content/plugins/a-synchronization/vendor/ee01/php-html-parser/src/PHPHtmlParser/Dom/ArrayNode.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PHPHtmlParser\\Dom\\ArrayNode' not found in wp-content/plugins/a-synchronization/vendor/ee01/php-html-parser/src/PHPHtmlParser/Dom/InnerNode.php:13
    • > PHP Fatal error
      require_once(): Failed opening required 'ASYNC_PLUGIN_DIRvendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/a-synchronization/includes/sync_ximalaya.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPHtmlParser\\Dom\\InnerNode' not found in wp-content/plugins/a-synchronization/vendor/ee01/php-html-parser/src/PHPHtmlParser/Dom/MockNode.php:11
    • > PHP Warning
      require_once(ASYNC_PLUGIN_DIRvendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/a-synchronization/includes/sync_ximalaya.php on line 5
    • > PHP Warning
      Use of undefined constant ASYNC_PLUGIN_DIR - assumed 'ASYNC_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/a-synchronization/includes/sync_ximalaya.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPHtmlParser\\Dom\\LeafNode' not found in wp-content/plugins/a-synchronization/vendor/ee01/php-html-parser/src/PHPHtmlParser/Dom/TextNode.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Async\\plugins_url() in wp-content/plugins/a-synchronization/Async.php:15
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/a-synchronization/vendor/paquettg/string-encode/vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/a-synchronization/vendor/paquettg/string-encode/phpunit.php on line 15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: wechat, sync, connect, ximalaya, distribute

a-synchronization/Async.php 92% from 13 tests

This is the main PHP file of "A Synchronization" version 1.1, 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 ("a-synchronization.php" instead of "Async.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected3,343 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
PHP436331,7252,939
JSON400174
PO File1313284
YAML24051
JavaScript17439
Markdown218031
XML11025

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity11.14
▷ Minimum class complexity1.00
▷ Maximum class complexity55.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces8
Interfaces3
Traits0
Classes34
▷ Abstract classes411.76%
▷ Concrete classes3088.24%
▷ Final classes826.67%
Methods234
▷ Static methods114.70%
▷ Public methods19382.48%
▷ Protected methods198.12%
▷ Private methods229.40%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.84MB with 0.58MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png196.60KB59.04KB▼ 69.97%
assets/ximalaya_icon.png116.83KB50.17KB▼ 57.06%
assets/default_acticle_image.png187.27KB51.39KB▼ 72.56%
assets/screenshot-2.png117.60KB32.94KB▼ 71.99%
assets/screenshot-3.png242.51KB69.35KB▼ 71.40%