10% scissors-watermark

Code Review | Scissors and Watermark

WordPress plugin Scissors and Watermark scored10%from 54 tests.

About plugin

  • Plugin page: scissors-watermark
  • Plugin version: 3.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.5
  • WordPress version: 6.3.1
  • First release: Jul 12, 2012
  • Latest release: Jan 2, 2013
  • Number of updates: 68
  • Update frequency: every 2.6 days
  • Top authors: aloziak (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

200+ active /14,996 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/scissors-watermark/functions.php+1476
    Methods with the same name as their class will not be constructors in a future version of PHP; Scissors has a deprecated constructor

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

Analyzing server-side resources used by Scissors and Watermark
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.82 ▲1.84
Dashboard /wp-admin3.36 ▲0.0645.33 ▼5.55
Posts /wp-admin/edit.php3.42 ▲0.0644.44 ▼2.93
Add New Post /wp-admin/post-new.php5.97 ▲0.0880.31 ▼14.91
Media Library /wp-admin/upload.php3.29 ▲0.0637.21 ▼1.52

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 55 new files
Database: no new tables, 23 new options
New WordPress options
scissors_watermark_size
large_adaptive
scissors_watermark_path
medium_crop
scissors_crop_defaultaspect
medium_adaptive
scissors_crop_defaultreir
large_crop
widget_recent-comments
scissors_watermark_size_relative
...

Browser metrics Passed 4 tests

An overview of browser requirements for Scissors and Watermark
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲7113.21 ▼1.171.68 ▼0.2944.55 ▼1.55
Dashboard /wp-admin2,226 ▲414.80 ▼0.0996.15 ▼2.5241.84 ▲2.72
Posts /wp-admin/edit.php2,107 ▲182.15 ▲0.0934.49 ▼2.1234.71 ▲1.15
Add New Post /wp-admin/post-new.php1,544 ▲2517.43 ▼5.60682.44 ▼8.5054.62 ▼2.00
Media Library /wp-admin/upload.php1,410 ▲224.30 ▲0.00108.98 ▼5.8449.34 ▲1.16

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 23 options
    • scissors_watermark_path
    • large_crop
    • theysaidso_admin_options
    • widget_recent-comments
    • scissors_watermark_size
    • scissors_watermark_halign
    • scissors_crop_useraspectx
    • can_compress_scripts
    • widget_theysaidso_widget
    • scissors_watermark_size_relative
    • ...

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/scissors-watermark/functions.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === scissors-watermark === )
  • Screenshots: Please add images for these screenshots: #1 (Cropping a picture from within WordPress), #2 (Extended media settings for automatic resizing, cropping, and watermarking)
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

scissors-watermark/scissors-and-watermark.php 85% from 13 tests

The primary PHP file in "Scissors and Watermark" version 3.2.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("scissors-watermark.php" instead of "scissors-and-watermark.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 172 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected4,802 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PO File191,2771,9052,904
PHP22371311,469
JavaScript44430383
CSS26146

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity44.00
▷ Minimum class complexity44.00
▷ Maximum class complexity44.00
Average method complexity5.30
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions63
▷ Named functions63100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/checkers.png0.11KB0.09KB▼ 13.51%
screenshot-2.png72.48KB28.95KB▼ 60.05%