84% wpwatermark

Code Review | WPWaterMark 轻水印插件

WordPress plugin WPWaterMark 轻水印插件 scored84%from 54 tests.

About plugin

  • Plugin page: wpwatermark
  • Plugin version: 4.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6.0-6.2
  • WordPress version: 6.3.1
  • First release: Nov 23, 2019
  • Latest release: May 13, 2023
  • Number of updates: 16
  • Update frequency: every 79.3 days
  • Top authors: laobuluo (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active /19,077 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.11MB] [CPU: ▼2.54ms] Passed 4 tests

This is a short check of server-side resources used by WPWaterMark 轻水印插件
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0737.45 ▼10.38
Dashboard /wp-admin3.43 ▲0.1250.69 ▲0.21
Posts /wp-admin/edit.php3.48 ▲0.1249.96 ▼0.16
Add New Post /wp-admin/post-new.php6.03 ▲0.1492.35 ▲0.18
Media Library /wp-admin/upload.php3.35 ▲0.1238.84 ▲1.39
轻水印插件设置 /wp-admin/tools.php?page=wpwatermark/index.php3.3333.32

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 36 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts
wpwatermark_options
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WPWaterMark 轻水印插件
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲8514.80 ▲0.432.11 ▲0.2442.96 ▼3.81
Dashboard /wp-admin2,212 ▲244.82 ▼0.06107.01 ▼7.8246.18 ▲2.79
Posts /wp-admin/edit.php2,095 ▲92.05 ▲0.0436.11 ▼1.6638.54 ▲1.31
Add New Post /wp-admin/post-new.php1,537 ▲2323.16 ▲5.62665.16 ▼24.6354.66 ▼3.81
Media Library /wp-admin/upload.php1,397 ▲124.24 ▲0.0496.07 ▼22.1245.75 ▼1.16
轻水印插件设置 /wp-admin/tools.php?page=wpwatermark/index.php1,5542.0443.47109.49

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

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
The smoke test was a success, however most plugin functionality was not tested

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 items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wpwatermark/index.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
2 plugin tags: wpwatermark, wordpress

wpwatermark/index.php 85% from 13 tests

Analyzing the main PHP file in "WPWaterMark 轻水印插件" version 4.2
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 ("wpwatermark.php" instead of "index.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 186 characters long)

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
No dangerous file extensions were detected1,207 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP43515838
SVG13563195
JavaScript7013168
CSS6046

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
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%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
5 PNG files occupy 0.14MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
layui/images/qrcode.png72.54KB12.37KB▼ 82.94%
layui/images/footer_logo.png24.74KB0.87KB▼ 96.48%
layui/css/modules/layer/default/icon-ext.png5.77KB2.91KB▼ 49.62%
layui/css/modules/layer/default/icon.png11.22KB4.36KB▼ 61.19%
layui/images/logo.png25.43KB0.87KB▼ 96.58%