62% picsmize

Code Review | Picsmize

WordPress plugin Picsmize scored62%from 54 tests.

About plugin

  • Plugin page: picsmize
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0
  • WordPress version: 6.3.1
  • First release: Jul 19, 2022
  • Latest release: Jul 19, 2022
  • Number of updates: 10
  • Update frequency: every 0.1 days
  • Top authors: softpulseinfotech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /177 total downloads

Benchmarks

Plugin footprint 65% 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 gracefully, with no errors

Server metrics [RAM: ▲0.27MB] [CPU: ▼5.70ms] Passed 4 tests

Server-side resources used by Picsmize
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2738.47 ▲2.69
Dashboard /wp-admin3.59 ▲0.2447.38 ▼9.47
Posts /wp-admin/edit.php3.70 ▲0.3449.20 ▲3.29
Add New Post /wp-admin/post-new.php6.19 ▲0.3085.88 ▼19.32
Media Library /wp-admin/upload.php3.51 ▲0.2837.61 ▲7.03
API Settings /wp-admin/admin.php?page=settings3.5032.12
Manual Upload /wp-admin/admin.php?page=pics-manual3.5031.65
Dashboard /wp-admin/admin.php?page=pics-dashboard3.5632.62
ALT Settings /wp-admin/admin.php?page=alt-change3.5433.50
Compress Settings /wp-admin/admin.php?page=compress3.4930.67
File Rename Settings /wp-admin/admin.php?page=rename3.5430.25

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 36 new files
Database: 1 new table, 6 new options
New tables
wp_pics_images
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Picsmize
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,882 ▲11113.79 ▼0.581.66 ▼0.3342.65 ▲2.77
Dashboard /wp-admin2,288 ▲965.20 ▲0.22113.56 ▲2.0950.04 ▲10.96
Posts /wp-admin/edit.php2,159 ▲672.37 ▲0.3437.25 ▼0.2040.66 ▲8.03
Add New Post /wp-admin/post-new.php1,571 ▲5723.75 ▲6.26709.31 ▲15.2661.55 ▲16.71
Media Library /wp-admin/upload.php1,532 ▲1444.55 ▲0.37101.61 ▼1.8951.25 ▲7.29
API Settings /wp-admin/admin.php?page=settings1,1001.9525.4645.47
Manual Upload /wp-admin/admin.php?page=pics-manual1,3392.6047.5662.34
Dashboard /wp-admin/admin.php?page=pics-dashboard1,7982.6245.5163.15
ALT Settings /wp-admin/admin.php?page=alt-change1,3352.0926.8337.98
Compress Settings /wp-admin/admin.php?page=compress1,0582.0825.6438.99
File Rename Settings /wp-admin/admin.php?page=rename1,3342.1126.6337.48

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie tables were found after uninstall: 1 table
    • wp_pics_images
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=compress
    • > Notice in wp-content/plugins/picsmize/templates/compressImage.php+93
    Undefined variable: jpegQuality
    • > GET request to /wp-admin/admin.php?page=compress
    • > Notice in wp-content/plugins/picsmize/templates/compressImage.php+93
    Undefined variable: pngQuality
    • > GET request to /wp-admin/admin.php?page=compress
    • > Notice in wp-content/plugins/picsmize/templates/compressImage.php+93
    Undefined variable: gifQuality

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/picsmize/templates/toast.php
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_statuses() in wp-content/plugins/picsmize/templates/image-history.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function picsCompressStyle() in wp-content/plugins/picsmize/templates/compressImage.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/picsmize/templates/auth.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/picsmize/templates/manual.php:20
    • > PHP Warning
      require(PICS_DIR/lib/Client.php): failed to open stream: No such file or directory in wp-content/plugins/picsmize/lib/Picsmize.php on line 3
    • > PHP Fatal error
      require(): Failed opening required 'PICS_DIR/lib/Client.php' (include_path='.:/usr/share/php') in wp-content/plugins/picsmize/lib/Picsmize.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PicsmizeCommon' not found in wp-content/plugins/picsmize/templates/altChange.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PicsmizeCommon' not found in wp-content/plugins/picsmize/templates/renameImage.php:2
    • > PHP Warning
      Use of undefined constant PICS_DIR - assumed 'PICS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/picsmize/lib/Picsmize.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/picsmize/includes/functions.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% 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
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === picsmize === )
The official readme.txt is a good inspiration

picsmize/picsmize.php Passed 13 tests

Analyzing the main PHP file in "Picsmize" version 1.0.0
130 characters long description:
Optimize & speed up your store by compressing product and other asset images with different modes like lossy, balanced & lossless.

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 detected6,862 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP163992422,872
CSS72,057182,512
JavaScript7185671,478

PHP code Passed 2 tests

An short overview of 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.37
Average class complexity28.20
▷ Minimum class complexity3.00
▷ Maximum class complexity96.00
Average method complexity3.67
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods51
▷ Static methods815.69%
▷ Public methods4894.12%
▷ Protected methods00.00%
▷ Private methods35.88%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants26
▷ Global constants830.77%
▷ Class constants1869.23%
▷ Public constants18100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.44MB with 0.30MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/pics-api.png85.67KB29.93KB▼ 65.06%
assets/images/pis-dashboard.png141.93KB41.60KB▼ 70.69%
assets/images/pics-rename.png67.33KB22.20KB▼ 67.04%
assets/images/pics-manual.png111.77KB31.74KB▼ 71.60%
assets/images/pics-compression.png45.70KB13.77KB▼ 69.86%