74% apoyl-weixinshare

Code Review | [凹凸曼]微信分享有图-WeChat Page Sharing

WordPress plugin [凹凸曼]微信分享有图-WeChat Page Sharing scored74%from 54 tests.

About plugin

  • Plugin page: apoyl-weixinshare
  • Plugin version: 2.3.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.1-6.4
  • WordPress version: 6.3.1
  • First release: Jun 15, 2019
  • Latest release: Nov 23, 2023
  • Number of updates: 38
  • Update frequency: every 42.7 days
  • Top authors: apoyl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /8,665 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼2.78ms] Passed 4 tests

An overview of server-side resources used by [凹凸曼]微信分享有图-WeChat Page Sharing
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.182,410.55 ▲2,370.46
Dashboard /wp-admin3.36 ▲0.0148.61 ▼12.09
Posts /wp-admin/edit.php3.47 ▲0.1248.68 ▲1.73
Add New Post /wp-admin/post-new.php5.94 ▲0.0593.74 ▲1.93
Media Library /wp-admin/upload.php3.28 ▲0.0535.53 ▼2.68
settings /wp-admin/options-general.php?page=apoyl-weixinshare-settings3.2932.51

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 26 new files
Database: 1 new table, 8 new options
New tables
wp_apoyl_weixinshare
New WordPress options
widget_recent-posts
apoyl_weixinshare_db_version
apoyl-weixinshare-settings
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

[凹凸曼]微信分享有图-WeChat Page Sharing: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,899 ▲13713.78 ▼0.458.70 ▲6.9435.99 ▼7.63
Dashboard /wp-admin2,202 ▲285.60 ▼0.0482.64 ▼5.7435.52 ▼6.18
Posts /wp-admin/edit.php2,104 ▲41.94 ▼0.0236.19 ▼3.0137.28 ▲1.39
Add New Post /wp-admin/post-new.php1,529 ▼723.41 ▲0.28658.17 ▼13.9566.54 ▲15.27
Media Library /wp-admin/upload.php1,398 ▲14.15 ▼0.0396.40 ▼29.1341.63 ▼11.44
settings /wp-admin/options-general.php?page=apoyl-weixinshare-settings9772.1525.5262.22

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_apoyl_weixinshare
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • apoyl_weixinshare_db_version
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apoyl_weixinshare_file() in wp-content/plugins/apoyl-weixinshare/public/partials/display.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apoyl_weixinshare_file() in wp-content/plugins/apoyl-weixinshare/admin/partials/list.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/apoyl-weixinshare/admin/partials/setting.php:29

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 93% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Contributors: Please add at least on tag
  • Contributors: The plugin contributors field is missing
The official readme.txt might help

apoyl-weixinshare/apoyl-weixinshare.php Passed 13 tests

This is the main PHP file of "[凹凸曼]微信分享有图-WeChat Page Sharing" version 2.3.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
63 characters long description:
实现文章在微信里分享朋友圈和分享朋友有图标

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin601 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP15116170596
JavaScript3205

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity5.78
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods39
▷ Static methods410.26%
▷ Public methods2666.67%
▷ Protected methods12.56%
▷ Private methods1230.77%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin