83% responsive-portfolio-image-gallery

Code Review | Portfolio Gallery - Photo Gallery and Image Gallery

WordPress plugin Portfolio Gallery - Photo Gallery and Image Gallery scored 83% from 54 tests.

About plugin

  • Plugin page: responsive-portfo...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3
  • WordPress version: 6.3.1
  • First release: Aug 9, 2016
  • Latest release: Aug 12, 2023
  • Number of updates: 72
  • Update frequency: every 35.5 days
  • Top authors: moviehour (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

200+ active / 10,069 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.33MB] [CPU: ▲0.67ms] Passed 4 tests

An overview of server-side resources used by Portfolio Gallery - Photo Gallery and Image Gallery
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2944.49 ▲2.01
Dashboard /wp-admin3.71 ▲0.4050.35 ▲1.80
Posts /wp-admin/edit.php3.76 ▲0.4050.83 ▼0.09
Add New Post /wp-admin/post-new.php6.22 ▲0.3397.48 ▼1.03
Media Library /wp-admin/upload.php3.55 ▲0.3139.45 ▲4.51
Portfolio Settings /wp-admin/edit.php?post_type=rcpig&page=rcpig-settings3.5438.56
All Portfolios /wp-admin/edit.php?post_type=rcpig3.6843.07
New Portfolio /wp-admin/post-new.php?post_type=rcpig3.6447.40
Portfolio Category /wp-admin/edit-tags.php?taxonomy=rcpig-category&post_type=rcpig3.5743.09

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 26 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
rcpig_style
can_compress_scripts
rcpig_advanced
rcpig_general
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Portfolio Gallery - Photo Gallery and Image Gallery
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,086 ▲32915.47 ▲1.097.26 ▲5.2841.85 ▼9.64
Dashboard /wp-admin2,399 ▲2116.66 ▲1.78126.78 ▲12.6539.97 ▲2.19
Posts /wp-admin/edit.php2,308 ▲2193.62 ▲1.6256.39 ▲15.6435.46 ▲0.29
Add New Post /wp-admin/post-new.php1,559 ▲1423.07 ▲4.73601.11 ▼16.8834.89 ▼18.13
Media Library /wp-admin/upload.php1,447 ▲594.32 ▲0.1182.65 ▼14.5340.95 ▼3.21
Portfolio Settings /wp-admin/edit.php?post_type=rcpig&page=rcpig-settings1,5573.6556.3365.29
All Portfolios /wp-admin/edit.php?post_type=rcpig1,3053.4849.6127.82
New Portfolio /wp-admin/post-new.php?post_type=rcpig2,4757.92188.0371.43
Portfolio Category /wp-admin/edit-tags.php?taxonomy=rcpig-category&post_type=rcpig1,4843.4343.5530.67

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • rcpig_advanced
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • rcpig_style
    • can_compress_scripts
    • theysaidso_admin_options
    • rcpig_general

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rcpig
    • > Notice in wp-content/plugins/responsive-portfolio-image-gallery/custom-post/rcpig_metabox.php+90
    Trying to access array offset on value of type bool

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
No output text or server-side errors detected on direct access of PHP files

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 87% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (Responsive Portfolio Image Gallery Settings.), #2 (Responsive Portfolio Image Gallery Thumbnail View.), #3 (Responsive Portfolio Image Gallery Expanded Preview.), #4 (Expanded preview with Light Color Scheme.)
  • Tags: Too many tags (18 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

responsive-portfolio-image-gallery/responsive-gallery.php 85% from 13 tests

This is the main PHP file of "Portfolio Gallery - Photo Gallery and Image Gallery" version 1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("responsive-portfolio-image-gallery.php" instead of "responsive-gallery.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected1,862 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP81753351,149
CSS3015431
PO File1102103237
JavaScript35945

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity21.50
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity3.22
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods37
▷ Static methods12.70%
▷ Public methods3594.59%
▷ Protected methods00.00%
▷ Private methods25.41%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
6 PNG files occupy 1.89MB with 0.89MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/nav-icon.png0.14KB0.11KB▼ 23.40%
screenshot-4.png686.77KB188.13KB▼ 72.61%
screenshot-2.png560.02KB190.59KB▼ 65.97%
screenshot-1.png15.54KB14.33KB▼ 7.79%
screenshot-3.png676.33KB229.40KB▼ 66.08%