84% simple-image-watermark

Code Review | Simple Image watermark

WordPress plugin Simple Image watermark scored84%from 54 tests.

About plugin

  • Plugin page: simple-image-wate...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.5
  • WordPress version: 6.3.1
  • First release: Dec 28, 2012
  • Latest release: Dec 28, 2012
  • Number of updates: 15
  • Update frequency: N/A
  • Top authors: am1r.root (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

70+ active /7,832 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▲1.70ms] Passed 4 tests

A check of server-side resources used by Simple Image watermark
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0546.55 ▲6.06
Dashboard /wp-admin3.36 ▲0.0648.28 ▼0.71
Posts /wp-admin/edit.php3.41 ▲0.0548.96 ▼1.35
Add New Post /wp-admin/post-new.php5.96 ▲0.07103.89 ▲6.93
Media Library /wp-admin/upload.php3.28 ▲0.0538.51 ▲2.81
Watermark options /wp-admin/options-general.php?page=siw_options_page3.2533.76

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
siw_plugin_options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Simple Image watermark: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.27 ▼1.112.01 ▲0.2936.88 ▼7.91
Dashboard /wp-admin2,210 ▲254.84 ▼1.01110.03 ▲7.0943.73 ▲0.94
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.1340.34 ▼0.2234.58 ▼3.61
Add New Post /wp-admin/post-new.php1,517 ▲317.60 ▲0.09668.44 ▲52.7458.34 ▲3.95
Media Library /wp-admin/upload.php1,395 ▲74.35 ▲0.1097.47 ▼13.2842.93 ▼1.46
Watermark options /wp-admin/options-general.php?page=siw_options_page9352.0040.0528.27

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
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • siw_plugin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not 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
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/simple-image-watermark/simple-image-watermark.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: admin, image, watermark, image watermark, simple image watermark...

simple-image-watermark/simple-image-watermark.php Passed 13 tests

The primary PHP file in "Simple Image watermark" version 1.0 is used by WordPress to initiate all plugin functionality
23 characters long description:
Add watermark to images

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
No dangerous file extensions were detected265 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP16824253
JavaScript11012

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
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%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There were not PNG files found in your plugin