93% simple-portfolio-gallery

Code Review | Simple Portfolio Gallery

WordPress plugin Simple Portfolio Gallery scored 93% from 54 tests.

About plugin

  • Plugin page: simple-portfolio-...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 5.9.2
  • First release: Dec 18, 2014
  • Latest release: Dec 18, 2014
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: Tauhidul Alam (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,836 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

A check of server-side resources used by Simple Portfolio Gallery
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1055.62 ▲6.16
Dashboard /wp-admin3.48 ▲0.0734.60 ▲1.96
Posts /wp-admin/edit.php3.70 ▲0.0639.14 ▲2.47
Add New Post /wp-admin/post-new.php6.95 ▼0.0395.56 ▼1,162.73
Media Library /wp-admin/upload.php3.36 ▲0.0623.91 ▼0.21
All Portfolios /wp-admin/edit.php?post_type=portfolios-gallery3.3924.53
Add New /wp-admin/post-new.php?post_type=portfolios-gallery3.7148.09

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 67 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Simple Portfolio Gallery
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,972 ▲25016.16 ▲0.549.63 ▲3.482.70 ▲0.20
Dashboard /wp-admin2,926 ▲726.10 ▼0.19117.12 ▼14.86156.39 ▼2.82
Posts /wp-admin/edit.php2,722 ▲283.24 ▲0.0162.47 ▼3.78141.86 ▲1.09
Add New Post /wp-admin/post-new.php1,684 ▼9516.53 ▼5.17429.19 ▼22.08160.30 ▼4.98
Media Library /wp-admin/upload.php1,735 ▲405.52 ▼0.04142.90 ▼0.92183.78 ▼2.82
All Portfolios /wp-admin/edit.php?post_type=portfolios-gallery1,4463.1760.22116.00
Add New /wp-admin/post-new.php?post_type=portfolios-gallery3,4819.98193.02223.59

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

Smoke tests 75% 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)
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/simple-portfolio-gallery/tpls/portfolio-gallery.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/simple-portfolio-gallery/portfolio-image-gallery.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Donate link: Invalid URI found ("")
  • Screenshots: These screenshots require images: #1 (Portfolio Gallery Admin Menu page.), #2 (Single Gallery page.), #3 (The pop-up window containing the portfolio details.)
You can look at the official readme.txt

simple-portfolio-gallery/portfolio-image-gallery.php 92% from 13 tests

Analyzing the main PHP file in "Simple Portfolio Gallery" version 0.1
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("simple-portfolio-gallery.php" instead of "portfolio-image-gallery.php")

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 detected18,732 lines of code in 50 files:
LanguageFilesBlank linesComment linesLines of code
CSS983119612,467
JavaScript109484523,569
Sass131922928
LESS121827907
SVG400673
PHP23721188

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.56
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 1.33MB with 0.95MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png194.30KB71.57KB▼ 63.17%
screenshot-2.png846.17KB180.75KB▼ 78.64%
screenshot-3.png319.23KB89.43KB▼ 71.99%