10% a-synchronization

Code Review | A Synchronization

WordPress plugin A Synchronization scored 10% 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: 5.9.2
  • 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 / 493 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • This plugin did not install gracefully
    • > 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.97MB] [CPU: ▼315.21ms] Passed 4 tests

An overview of server-side resources used by A Synchronization
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0256.13 ▲5.70
Dashboard /wp-admin3.44 ▲0.0332.21 ▼2.44
Posts /wp-admin/edit.php3.43 ▼0.2127.00 ▼9.72
Add New Post /wp-admin/post-new.php3.25 ▼3.7228.85 ▼1,247.09
Media Library /wp-admin/upload.php3.32 ▲0.0223.62 ▼1.60
Async Settings /wp-admin/options-general.php?page=Async_setting3.2622.03

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 66 new files
Database: no new tables, 1 new option
New WordPress options
Async_setting

Browser metrics Passed 4 tests

An overview of browser requirements for A Synchronization
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,800 ▲4616.11 ▲0.785.95 ▼0.053.56 ▲1.02
Dashboard /wp-admin2,897 ▲436.14 ▼0.07114.34 ▼20.05154.04 ▼7.43
Posts /wp-admin/edit.php2,710 ▲163.24 ▲0.0164.23 ▼3.68141.55 ▼1.15
Add New Post /wp-admin/post-new.php1,735 ▲1619.08 ▼3.64407.61 ▼5.07172.05 ▲11.11
Media Library /wp-admin/upload.php1,700 ▲55.56 ▲0.09139.71 ▼11.07187.34 ▼0.44
Async Settings /wp-admin/options-general.php?page=Async_setting1,4514.3969.82139.53

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • Async_setting

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 15× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > 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/LeafNode.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Async\\plugins_url() in wp-content/plugins/a-synchronization/Async.php:15
    • > 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 Fatal error
      Uncaught Error: Interface 'PHPHtmlParser\\CurlInterface' not found in wp-content/plugins/a-synchronization/vendor/ee01/php-html-parser/src/PHPHtmlParser/Curl.php:11
    • > 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: Interface 'PHPHtmlParser\\Selector\\ParserInterface' not found in wp-content/plugins/a-synchronization/vendor/ee01/php-html-parser/src/PHPHtmlParser/Selector/Parser.php:9
    • > 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 Fatal error
      Uncaught Error: Class 'PHPHtmlParser\\Dom\\InnerNode' not found in wp-content/plugins/a-synchronization/vendor/ee01/php-html-parser/src/PHPHtmlParser/Dom/HtmlNode.php:12
    • > 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
    • > 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

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: distribute, connect, sync, wechat, ximalaya

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

"A Synchronization" version 1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("a-synchronization.php" instead of "Async.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin3,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

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
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

PNG files should be compressed to save space and minimize bandwidth usage
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-2.png117.60KB32.94KB▼ 71.99%
assets/ximalaya_icon.png116.83KB50.17KB▼ 57.06%
assets/screenshot-3.png242.51KB69.35KB▼ 71.40%
assets/screenshot-1.png196.60KB59.04KB▼ 69.97%
assets/default_acticle_image.png187.27KB51.39KB▼ 72.56%