10% wptao

Code Review | WordPress淘宝客插件

WordPress plugin WordPress淘宝客插件 scored10%from 54 tests.

About plugin

  • Plugin page: wptao
  • Plugin version: 3.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.0.2
  • WordPress version: 6.3.1
  • First release: Jul 17, 2015
  • Latest release: Sep 20, 2022
  • Number of updates: 153
  • Update frequency: every 17.1 days
  • Top authors: smyx (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /23,560 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/wptao/wptao.php+40
    Undefined index: caiji

Server metrics [RAM: ▼1.94MB] [CPU: ▼56.82ms] Passed 4 tests

Server-side resources used by WordPress淘宝客插件
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.415.11 ▼44.81
Dashboard /wp-admin2.08 ▼1.276.23 ▼58.82
Posts /wp-admin/edit.php2.08 ▼1.287.19 ▼42.34
Add New Post /wp-admin/post-new.php2.08 ▼3.816.42 ▼81.29
Media Library /wp-admin/upload.php2.08 ▼1.155.85 ▼31.36

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for WordPress淘宝客插件
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲7714.34 ▼0.011.86 ▼0.1742.64 ▲0.21
Dashboard /wp-admin2,205 ▲375.61 ▲0.0292.95 ▼3.0785.78 ▲42.70
Posts /wp-admin/edit.php2,125 ▲251.97 ▲0.0041.23 ▲3.2445.30 ▲9.51
Add New Post /wp-admin/post-new.php1,546 ▲2023.61 ▲0.44765.94 ▲69.5759.81 ▲13.90
Media Library /wp-admin/upload.php1,422 ▲224.12 ▼0.01102.44 ▼16.8590.33 ▲42.99

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/wptao/wptao.php+40
    Undefined index: caiji
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wptao/admin/admin.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wptao/functions.php:326
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wptao/functions.php on line 249
    • > PHP Notice
      Undefined variable: wptao_options in wp-content/plugins/wptao/functions.php on line 249
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wptao/wptao.php:14

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

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === wptao === )
The official readme.txt might help

wptao/wptao.php 92% from 13 tests

Analyzing the main PHP file in "WordPress淘宝客插件" version 3.6
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 244 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin2,708 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP5261232,552
CSS300112
JavaScript401444

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions56
▷ Named functions56100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/soldout.png1.82KB1.85KB0.00%
admin/wptao/icon.png0.93KB0.19KB▼ 79.05%
images/icon.png0.93KB0.19KB▼ 79.05%
images/close1.png0.61KB0.78KB0.00%