84% image-formatr

Code Review | Image Formatr

WordPress plugin Image Formatr scored84%from 54 tests.

About plugin

  • Plugin page: image-formatr
  • Plugin version: 1.2.6
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-4.4
  • WordPress version: 6.3.1
  • First release: Jan 5, 2010
  • Latest release: Dec 13, 2015
  • Number of updates: 125
  • Update frequency: every 17.4 days
  • Top authors: huntermaster (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

80+ active /19,997 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▲0.51ms] Passed 4 tests

Analyzing server-side resources used by Image Formatr
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2344.04 ▲1.60
Dashboard /wp-admin3.58 ▲0.2760.33 ▲11.00
Posts /wp-admin/edit.php3.69 ▲0.3357.98 ▲5.55
Add New Post /wp-admin/post-new.php6.16 ▲0.2791.82 ▼16.11
Media Library /wp-admin/upload.php3.50 ▲0.2747.81 ▲12.17
Image Formatr /wp-admin/options-general.php?page=class.admin.php3.4737.50

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 51 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
plugin_image-formatr
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Image Formatr
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,893 ▲13213.40 ▼0.889.18 ▲7.4341.75 ▲0.86
Dashboard /wp-admin2,216 ▲395.56 ▲0.0290.34 ▼1.1242.83 ▲1.77
Posts /wp-admin/edit.php2,116 ▲132.05 ▲0.0836.63 ▼9.5734.33 ▼5.77
Add New Post /wp-admin/post-new.php1,536 ▼122.64 ▲4.37685.16 ▲30.2661.21 ▼3.75
Media Library /wp-admin/upload.php1,413 ▲134.22 ▲0.0599.57 ▼4.7643.23 ▼0.61
Image Formatr /wp-admin/options-general.php?page=class.admin.php2,0322.0426.8532.98

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • plugin_image-formatr
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/image-formatr/image-formatr.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: post, flickr, images, caption, formatting...

image-formatr/image-formatr.php Passed 13 tests

"Image Formatr" version 1.2.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
76 characters long description:
Formats all content images on a page / post giving them captions and popups.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected2,322 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP51672871,049
JavaScript118395637
CSS28729435
PO File17276201

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity41.25
▷ Minimum class complexity20.00
▷ Maximum class complexity85.00
Average method complexity4.50
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods46
▷ Static methods00.00%
▷ Public methods46100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants120.00%
▷ Class constants480.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
27 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/prettyPhoto/light_rounded/btnNext.png1.38KB1.14KB▼ 17.29%
images/prettyPhoto/dark_square/btnNext.png1.38KB1.14KB▼ 17.29%
images/prettyPhoto/facebook/sprite.png4.13KB2.26KB▼ 45.33%
images/prettyPhoto/facebook/contentPatternRight.png0.13KB0.10KB▼ 24.26%
images/prettyPhoto/default/sprite_prev.png1.34KB0.38KB▼ 71.73%