10% jiaoliuping

Code Review | Plugin Name:交流瓶Wordpress插件

WordPress plugin Plugin Name:交流瓶Wordpress插件scored 10% from 54 tests.

About plugin

  • Plugin page: jiaoliuping
  • Plugin version: 0.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.2-3.4.1
  • WordPress version: 5.8.1
  • First release: Jul 4, 2013
  • Latest release: Sep 4, 2013
  • Number of updates: 28
  • Update frequency: every 3.6 days
  • Top authors: liizii (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,148 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/jiaoliuping/consumer/ydhl_oauthclient.php+8
    Methods with the same name as their class will not be constructors in a future version of PHP; YDHL_OAuthClient has a deprecated constructor

Server metrics [RAM: ▼1.76MB] [CPU: ▼186.21ms] Passed 4 tests

An overview of server-side resources used by Plugin Name:交流瓶Wordpress插件
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.87 ▼0.858.88 ▼12.07
Dashboard /wp-admin1.89 ▼1.176.25 ▼29.31
Posts /wp-admin/edit.php1.89 ▼1.225.66 ▼38.13
Add New Post /wp-admin/post-new.php1.89 ▼3.556.50 ▼648.74
Media Library /wp-admin/upload.php1.89 ▼1.126.41 ▼28.65

Server storage [IO: ▲0.23MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 42 new files
Database: 6 new tables, 1 new option
New tables
wp_ydhl_oauth_client_endpoints
wp_ydhl_oauth_clients
wp_ydhl_oauth_scopes
wp_ydhl_oauth_session_scopes
wp_ydhl_oauth_sessions
wp_ydhl_oauth_logins
New WordPress options
jiaoliuping_admin_id

Browser metrics Passed 4 tests

An overview of browser requirements for Plugin Name:交流瓶Wordpress插件
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,732 ▲13616.24 ▲0.2510.11 ▼0.9249.79 ▲2.63
Dashboard /wp-admin2,979 ▲485.90 ▼0.14135.70 ▼8.80151.57 ▲43.96
Posts /wp-admin/edit.php2,759 ▲232.60 ▼0.1264.32 ▲1.8988.54 ▲5.17
Add New Post /wp-admin/post-new.php1,659 ▼2421.44 ▲2.72286.12 ▼116.37148.77 ▲40.89
Media Library /wp-admin/upload.php1,770 ▼405.02 ▼0.01139.13 ▼19.54142.15 ▲30.89

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/jiaoliuping/consumer/ydhl_oauthclient.php+8
    Methods with the same name as their class will not be constructors in a future version of PHP; YDHL_OAuthClient has a deprecated constructor
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_ydhl_oauth_logins
  • Zombie WordPress options were found after uninstall: 1 option
    • jiaoliuping_admin_id

Smoke tests 50% 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 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
Please fix the following
  • 8× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/jiaoliuping/signin.php
    • > /wp-content/plugins/jiaoliuping/reply.php
    • > /wp-content/plugins/jiaoliuping/access_token.php
    • > /wp-content/plugins/jiaoliuping/authorise.php
    • > /wp-content/plugins/jiaoliuping/update.php
    • > /wp-content/plugins/jiaoliuping/post.php
    • > /wp-content/plugins/jiaoliuping/replylist.php
    • > /wp-content/plugins/jiaoliuping/userinfo.php
  • 14× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'OAuth2\\Grant\\GrantTypeInterface' not found in wp-content/plugins/jiaoliuping/sp/Password.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'OAuth2\\Grant\\GrantTypeInterface' not found in wp-content/plugins/jiaoliuping/sp/RefreshToken.php:25
    • > PHP Notice
      Undefined index: access_token in wp-content/plugins/jiaoliuping/userinfo.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/jiaoliuping/jiaoliuping.php:383
    • > PHP Fatal error
      Uncaught Error: Class 'OAuth2\\Exception\\OAuth2Exception' not found in wp-content/plugins/jiaoliuping/sp/InvalidAccessTokenException.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'OAuth2\\Exception\\OAuth2Exception' not found in wp-content/plugins/jiaoliuping/sp/InvalidGrantTypeException.php:17
    • > PHP Notice
      Undefined index: access_token in wp-content/plugins/jiaoliuping/replylist.php on line 4
    • > PHP Notice
      Undefined index: regsite in wp-content/plugins/jiaoliuping/config.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/jiaoliuping/authorise.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/jiaoliuping/config.php:189

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Contributors: Please add at least on tag
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === Plugin Name:交流瓶Wordpress插件=== )
  • Contributors: Contributors not specified
The official readme.txt might help

jiaoliuping/jiaoliuping.php 92% from 13 tests

The main PHP file in "Plugin Name:交流瓶Wordpress插件" ver. 0.2.2 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 424 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin4,558 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
CSS218372,429
PHP354959952,129

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity5.20
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces5
Interfaces5
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes00.00%
Methods111
▷ Static methods1816.22%
▷ Public methods10695.50%
▷ Protected methods54.50%
▷ Private methods00.00%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bootstrap/img/glyphicons-halflings.png12.50KB10.35KB▼ 17.19%
jiaoliuping.png1.62KB1.42KB▼ 12.51%
bootstrap/img/glyphicons-halflings-white.png8.57KB9.20KB0.00%
icon.png0.46KB0.32KB▼ 31.37%