78% dynamic-watermark

Code Review | Dynamic Watermark

WordPress plugin Dynamic Watermark scored 78% from 54 tests.

About plugin

  • Plugin page: dynamic-watermark
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.6.0
  • WordPress version: 5.9.2
  • First release: Jun 7, 2016
  • Latest release: Sep 2, 2016
  • Number of updates: 9
  • Update frequency: every 9.6 days
  • Top authors: denis_golovin (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

10+ active / 2,172 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼285.67ms] Passed 4 tests

This is a short check of server-side resources used by Dynamic Watermark
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0253.11 ▲2.05
Dashboard /wp-admin3.46 ▲0.0537.84 ▲4.30
Posts /wp-admin/edit.php3.69 ▲0.0543.14 ▲2.63
Add New Post /wp-admin/post-new.php6.90 ▼0.0793.57 ▼1,149.34
Media Library /wp-admin/upload.php3.31 ▲0.0224.65 ▲1.99
Dynamic Watermark /wp-admin/options-general.php?page=dynamic_watermark3.3034.41

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 36 new files
Database: no new tables, 6 new options
New WordPress options
codeneric/dw/watermark/pos-h
cc_dw_curr_version
cc_dynamic_watermark_id
codeneric/dw/watermark/scale
codeneric/dw/watermark/pos-v
cc_dynamic_watermark_settings

Browser metrics Passed 4 tests

A check of browser resources used by Dynamic Watermark
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,963 ▲24117.46 ▲1.835.68 ▼0.152.22 ▼0.47
Dashboard /wp-admin3,092 ▲2418.02 ▲1.80140.19 ▲3.91159.90 ▲0.92
Posts /wp-admin/edit.php2,923 ▲2295.25 ▲2.0278.77 ▲11.66139.97 ▼5.10
Add New Post /wp-admin/post-new.php1,666 ▲516.36 ▲0.67384.76 ▼33.62159.08 ▲8.95
Media Library /wp-admin/upload.php1,703 ▲55.55 ▲0.00107.29 ▼36.58181.34 ▼6.56
Dynamic Watermark /wp-admin/options-general.php?page=dynamic_watermark1,4314.5265.86135.21

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • cc_dw_curr_version
    • codeneric/dw/watermark/scale
    • cc_dynamic_watermark_id
    • codeneric/dw/watermark/pos-v
    • codeneric/dw/watermark/pos-h
    • cc_dynamic_watermark_settings

Smoke tests 50% 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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dynamic-watermark/admin/subpages/options.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/dynamic-watermark/admin/shortcode.php:77

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=dynamic_watermark
    • > Javascript (severe) in unknown
    /wp-content/plugins/dynamic-watermark/admin/js/media-uploader.js?ver=5.9.2 3:31 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === dynamic-watermark === )
The official readme.txt is a good inspiration

dynamic-watermark/dynamic-watermark.php 92% from 13 tests

The primary PHP file in "Dynamic Watermark" version 1.2.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin1,397 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP236351,0711,369
JavaScript2111828

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity8.76
▷ Minimum class complexity1.00
▷ Maximum class complexity41.00
Average method complexity3.28
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods58
▷ Static methods1118.97%
▷ Public methods4170.69%
▷ Protected methods1118.97%
▷ Private methods610.34%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants19.09%
▷ Class constants1090.91%
▷ Public constants10100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/watermark.png26.10KB11.81KB▼ 54.76%