10% cyberprojekt-image-watermark

Code Review | CyberProjekt Image Watermark

WordPress plugin CyberProjekt Image Watermark scored10%from 54 tests.

About plugin

  • Plugin page: cyberprojekt-imag...
  • Plugin version: 0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.7.2
  • WordPress version: 6.3.1
  • First release: May 2, 2014
  • Latest release: Jan 28, 2017
  • Number of updates: 35
  • Update frequency: every 28.7 days
  • Top authors: cyberprojekt (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active /4,657 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/cyberprojekt-image-watermark/libs/Config/trait-config-set_data-main.php+17
    array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead

Server metrics [RAM: ▼1.29MB] [CPU: ▼55.21ms] Passed 4 tests

Analyzing server-side resources used by CyberProjekt Image Watermark
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.69 ▼0.778.86 ▼36.77
Dashboard /wp-admin2.71 ▼0.5910.39 ▼42.21
Posts /wp-admin/edit.php2.71 ▼0.6410.08 ▼42.53
Add New Post /wp-admin/post-new.php2.71 ▼3.179.23 ▼99.34
Media Library /wp-admin/upload.php2.71 ▼0.5212.66 ▼23.96
Image Watermark /wp-admin/options-general.php?page=image_watermark2.7110.85

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 156 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for CyberProjekt Image Watermark
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.31 ▲0.091.82 ▲0.3344.16 ▲2.46
Dashboard /wp-admin2,196 ▲195.65 ▼0.0694.41 ▲6.6141.85 ▼1.92
Posts /wp-admin/edit.php2,104 ▲41.97 ▼0.0833.48 ▼6.8633.66 ▼2.65
Add New Post /wp-admin/post-new.php1,529 ▼217.80 ▼5.55623.46 ▼36.3551.68 ▼7.21
Media Library /wp-admin/upload.php1,404 ▲44.23 ▲0.05106.35 ▲4.9045.29 ▼2.31
Image Watermark /wp-admin/options-general.php?page=image_watermark1,7283.6680.9388.52

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/cyberprojekt-image-watermark/libs/Config/trait-config-set_data-main.php+17
    array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 66 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=image_watermark
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/cyberprojekt-image-watermark/libs/Config/trait-config-set_data-main.php+17
    array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead
    • > GET request to /wp-admin/options-general.php?page=image_watermark
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/cyberprojekt-image-watermark/libs/class-dispatcher.php+36
    filter_input(): FILTER_SANITIZE_MAGIC_QUOTES is deprecated, use FILTER_SANITIZE_ADD_SLASHES instead

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
  • 30× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Cyberprojekt\\Iw\\Parser\\Parser' not found in wp-content/plugins/cyberprojekt-image-watermark/libs/Parser/class-parser-gif.php:9
    • > PHP Fatal error
      Trait 'Cyberprojekt\\Iw\\Config\\Config_To_Flat_Array' not found in wp-content/plugins/cyberprojekt-image-watermark/libs/Config/class-config.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'Cyberprojekt\\Iw\\Form\\Element' not found in wp-content/plugins/cyberprojekt-image-watermark/libs/Form/class-text.php:9
    • > PHP Fatal error
      Trait 'Cyberprojekt\\Iw\\Config\\Config_To_Flat_Array' not found in wp-content/plugins/cyberprojekt-image-watermark/libs/Config/class-config-image.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'Cyberprojekt\\Iw\\Form\\Element' not found in wp-content/plugins/cyberprojekt-image-watermark/libs/Form/class-hidden.php:4
    • > PHP Fatal error
      Trait 'Cyberprojekt\\Iw\\Config\\Config_To_Flat_Array' not found in wp-content/plugins/cyberprojekt-image-watermark/libs/Config/class-config-text.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'Cyberprojekt\\Iw\\Form\\Multi' not found in wp-content/plugins/cyberprojekt-image-watermark/libs/Form/class-select.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Cyberprojekt\\Iw\\Controller\\Ajax_Controller' not found in wp-content/plugins/cyberprojekt-image-watermark/libs/Controller/class-watermark-multiple-controller.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Cyberprojekt\\Iw\\Form\\Radio_Checkbox' not found in wp-content/plugins/cyberprojekt-image-watermark/libs/Form/class-checkbox.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Cyberprojekt\\Iw\\Controller\\Ajax_Controller' not found in wp-content/plugins/cyberprojekt-image-watermark/libs/Controller/class-font-image-preview-controller.php:11

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (screenshot-1.jpg), #2 (screenshot-2.jpg), #3 (screenshot-3.jpg), #4 (screenshot-4.jpg), #5 (screenshot-5.jpg)
You can take inspiration from this readme.txt

cyberprojekt-image-watermark/cyberprojekt_image_watermark.php 92% from 13 tests

"CyberProjekt Image Watermark" version 0.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("cyberprojekt-image-watermark.php" instead of "cyberprojekt_image_watermark.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected7,907 lines of code in 71 files:
LanguageFilesBlank linesComment linesLines of code
PHP665861,3005,196
JSON1001,455
JavaScript12612712
CSS14214283
PO File1106114233
Markdown110028

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity5.72
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.14
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces16
Interfaces0
Traits4
Classes56
▷ Abstract classes712.50%
▷ Concrete classes4987.50%
▷ Final classes00.00%
Methods256
▷ Static methods93.52%
▷ Public methods18973.83%
▷ Protected methods6525.39%
▷ Private methods20.78%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants13
▷ Global constants00.00%
▷ Class constants13100.00%
▷ Public constants13100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
16 PNG files occupy 0.16MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/images/pics.png7.01KB1.22KB▼ 82.59%
inc/images/settings.png7.44KB1.64KB▼ 77.91%
inc/images/browser.png4.37KB1.96KB▼ 55.19%
inc/images/reload.png1.36KB1.39KB0.00%
inc/images/jquery.minicolors.png75.64KB34.31KB▼ 54.64%