93% popup-image

Code Review | Popup Image

WordPress plugin Popup Image scored 93% from 54 tests.

About plugin

  • Plugin page: popup-image
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-4.7.1
  • WordPress version: 5.8.1
  • First release: Jan 16, 2017
  • Latest release: Jan 27, 2017
  • Number of updates: 6
  • Update frequency: every 1.3 days
  • Top authors: hussam7ussien (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 1,124 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

This is a short check of server-side resources used by Popup Image
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.0534.66 ▼1.87
Dashboard /wp-admin3.10 ▲0.0553.46 ▲0.34
Posts /wp-admin/edit.php3.22 ▲0.1144.69 ▼7.82
Add New Post /wp-admin/post-new.php5.46 ▲0.0392.96 ▼577.80
Media Library /wp-admin/upload.php3.05 ▲0.0537.75 ▲0.12

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 29 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Popup Image
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,816 ▲24416.30 ▲0.6513.14 ▲4.1948.78 ▼2.31
Dashboard /wp-admin2,971 ▲405.85 ▼0.09155.62 ▼9.26113.95 ▲1.25
Posts /wp-admin/edit.php2,743 ▲42.72 ▲0.0289.35 ▲18.8595.15 ▲0.94
Add New Post /wp-admin/post-new.php1,687 ▼1,88818.75 ▲3.93401.72 ▼136.15109.69 ▼5.37
Media Library /wp-admin/upload.php1,808 ▲15.04 ▲0.04164.58 ▼8.02119.29 ▲0.06

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/popup-image/public/partials/popup_image-public-display.php
    • > /wp-content/plugins/popup-image/admin/partials/popup_image-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 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: lighbox, thumbinal, modal, popup, fancybox...

popup-image/popup_image.php 85% from 13 tests

The primary PHP file in "Popup Image" version 1.0.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Main file name: Name the main plugin file the same as the plugin slug ("popup-image.php" instead of "popup_image.php")

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 detected272 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12131535191
CSS2101169
JavaScript284512

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.07
Average class complexity1.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.12
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods25
▷ Static methods28.00%
▷ Public methods2080.00%
▷ Protected methods00.00%
▷ Private methods520.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.51MB with 0.26MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png3.12KB2.61KB▼ 16.40%
assets/icon-256x256.png6.73KB4.58KB▼ 31.84%
assets/screenshot-1.png57.43KB19.19KB▼ 66.59%
assets/screenshot-3.png319.46KB114.34KB▼ 64.21%
assets/screenshot-2.png139.74KB42.77KB▼ 69.39%