79% wppao-image

Code Review | Wppao Image

WordPress plugin Wppao Image scored79%from 54 tests.

About plugin

  • Plugin page: wppao-image
  • Plugin version: 1.2.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4.1
  • WordPress version: 6.3.1
  • First release: May 26, 2020
  • Latest release: May 26, 2020
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: mryuanshu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,442 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.96ms] Passed 4 tests

An overview of server-side resources used by Wppao Image
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0133.27 ▼2.69
Dashboard /wp-admin3.32 ▼0.0343.78 ▼15.48
Posts /wp-admin/edit.php3.37 ▲0.0145.05 ▼3.73
Add New Post /wp-admin/post-new.php5.90 ▲0.0192.84 ▼1.95
Media Library /wp-admin/upload.php3.24 ▲0.0134.53 ▲3.16
WP泡图片增强 /wp-admin/admin.php?page=wppaoimage3.2531.31
插件调试 /wp-admin/admin.php?page=wppaoimage_helper3.2128.44

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Wppao Image
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲8013.19 ▼1.251.62 ▲0.0839.70 ▼2.25
Dashboard /wp-admin2,229 ▲414.93 ▼0.97103.63 ▲3.8375.49 ▲32.93
Posts /wp-admin/edit.php2,121 ▲322.03 ▼0.0138.19 ▲1.0143.20 ▲10.51
Add New Post /wp-admin/post-new.php1,544 ▲2518.37 ▼4.72643.75 ▲22.7561.25 ▲9.76
Media Library /wp-admin/upload.php1,411 ▲234.21 ▲0.0196.29 ▲1.9378.35 ▲37.09
WP泡图片增强 /wp-admin/admin.php?page=wppaoimage1,3963.6963.86316.72
插件调试 /wp-admin/admin.php?page=wppaoimage_helper8162.1423.7262.15

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=wppaoimage
    • > Notice in wp-content/plugins/wppao-image/module/watermark.php+380
    Undefined variable: fonts

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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wppao-image/options/initialization.php:8

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)
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
2 plugin tags: image, watermark

wppao-image/wppao-image.php Passed 13 tests

The main PHP file in "Wppao Image" ver. 1.2.0 adds more information about the plugin and also serves as the entry point for this plugin
117 characters long description:
提供网站编辑过程中,必须要使用的一些图片功能,如图片远程本地化,图片水印等等。

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin956 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP6106125664
CSS1290182
JavaScript2102110

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity49.33
▷ Minimum class complexity4.00
▷ Maximum class complexity93.00
Average method complexity6.58
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods26
▷ Static methods519.23%
▷ Public methods2388.46%
▷ Protected methods00.00%
▷ Private methods311.54%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
imgs/plugin_icon.png0.44KB0.36KB▼ 17.90%
options/images/qqmail.png1.81KB1.76KB▼ 2.70%
options/images/qun.png1.78KB1.74KB▼ 2.46%