78% ahime-image-printer

Code Review | Ahime Image Printer

WordPress plugin Ahime Image Printer scored78%from 54 tests.

About plugin

  • Plugin page: ahime-image-printer
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 11, 2023
  • Latest release: Feb 11, 2023
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: nahimsalami (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /374 total downloads


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
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼9.37ms] Passed 4 tests

An overview of server-side resources used by Ahime Image Printer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2339.90 ▼4.90
Dashboard /wp-admin3.40 ▲0.1040.25 ▼9.10
Posts /wp-admin/edit.php3.47 ▲0.1140.88 ▼8.21
Add New Post /wp-admin/post-new.php5.65 ▼0.2480.16 ▼15.28
Media Library /wp-admin/upload.php3.41 ▲0.1835.34 ▼3.96

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 1,693 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

An overview of browser requirements for Ahime Image Printer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,939 ▲19313.99 ▼0.437.34 ▲5.5837.18 ▼11.16
Dashboard /wp-admin2,238 ▲505.86 ▲0.97102.95 ▼17.1546.51 ▲2.40
Posts /wp-admin/edit.php2,118 ▲292.15 ▲0.1638.22 ▼0.3834.97 ▼1.84
Add New Post /wp-admin/post-new.php1,543 ▲2423.24 ▼0.07678.26 ▲56.9060.92 ▲11.06
Media Library /wp-admin/upload.php1,420 ▲354.21 ▲0.03101.69 ▼21.8344.57 ▼7.23

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ahime-image-printer/public/partials/ahime-image-printer-public-display.php
    • > /wp-content/plugins/ahime-image-printer/admin/partials/ahime-image-printer-admin-display.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/ahime-image-printer/public/partials/printing-shortcode.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test


Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (The front end view ahime-image-capture-1.png), #2 (This is the third screen shot ahime-image-capture-3.png)
The official readme.txt might help

ahime-image-printer/ahime-image-printer.php Passed 13 tests

The main PHP file in "Ahime Image Printer" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
40 characters long description:
A simple tool to resize and print images

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin25,124 lines of code in 1,674 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity13.62
▷ Minimum class complexity1.00
▷ Maximum class complexity56.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
▷ Static methods35.66%
▷ Public methods4483.02%
▷ Protected methods00.00%
▷ Private methods916.98%
▷ Named functions4100.00%
▷ Anonymous functions00.00%
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings