78% portfolio-responsive-gallery

Code Review | Portfolio Responsive Gallery

WordPress plugin Portfolio Responsive Gallery scored78%from 54 tests.

About plugin

  • Plugin page: portfolio-respons...
  • Plugin version: 1.4.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jun 18, 2019
  • Latest release: Nov 28, 2023
  • Number of updates: 119
  • Update frequency: every 13.7 days
  • Top authors: ays-pro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /3,802 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.56MB] [CPU: ▼5.39ms] Passed 4 tests

Analyzing server-side resources used by Portfolio Responsive Gallery
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.02 ▲0.5538.01 ▼3.24
Dashboard /wp-admin3.90 ▲0.5649.30 ▼14.18
Posts /wp-admin/edit.php3.94 ▲0.5851.11 ▲6.24
Add New Post /wp-admin/post-new.php6.53 ▲0.6485.39 ▼8.97
Media Library /wp-admin/upload.php3.78 ▲0.5539.38 ▲4.82
How to use /wp-admin/admin.php?page=portfolio-responsive-gallery-portfolio-how_to_use3.8541.83
Portfolio Responsive Gallery /wp-admin/options-general.php?page=portfolio-responsive-gallery3.8644.68
Portfolios /wp-admin/admin.php?page=portfolio-responsive-gallery3.8642.60
Attributes /wp-admin/admin.php?page=portfolio-responsive-gallery-portfolio-attributes3.8647.10

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 113 new files
Database: 3 new tables, 10 new options
New tables
wp_ays_portfolio_items
wp_ays_portfolio
wp_ays_portfolio_attributes
New WordPress options
can_compress_scripts
ays_prg_banner_time
theysaidso_admin_options
ays_prg_db_version
widget_recent-posts
widget_recent-comments
ays_prg_sale_btn_for_two_months
ays_prg_sale_btn
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Portfolio Responsive Gallery
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲6914.21 ▼0.521.61 ▼0.3737.15 ▼6.52
Dashboard /wp-admin2,231 ▲505.56 ▼0.1394.47 ▼8.5982.20 ▲40.28
Posts /wp-admin/edit.php2,151 ▲481.95 ▼0.0136.45 ▲0.1935.41 ▲3.52
Add New Post /wp-admin/post-new.php1,568 ▲4222.87 ▼0.32686.33 ▼50.1847.15 ▼13.09
Media Library /wp-admin/upload.php1,448 ▲454.23 ▲0.0597.98 ▲1.3467.32 ▲26.06
How to use /wp-admin/admin.php?page=portfolio-responsive-gallery-portfolio-how_to_use1,6755.0477.44192.21
Portfolio Responsive Gallery /wp-admin/options-general.php?page=portfolio-responsive-gallery1,8345.0466.78114.31
Portfolios /wp-admin/admin.php?page=portfolio-responsive-gallery1,8345.0466.49121.56
Attributes /wp-admin/admin.php?page=portfolio-responsive-gallery-portfolio-attributes1,8645.0664.16126.15

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 9 options
    • db_upgraded
    • ays_prg_banner_time
    • widget_recent-comments
    • can_compress_scripts
    • ays_prg_sale_btn_for_two_months
    • widget_recent-posts
    • ays_prg_sale_btn
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 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
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/portfolio-responsive-gallery/public/partials/portfolio-responsive-gallery-public-display.php
  • 10× 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/portfolio-responsive-gallery/admin/partials/attributes/portfolio-responsive-gallery-attributes-display.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/portfolio-responsive-gallery/includes/lists/class-portfolio-responsive-gallery-list-table.php:4
    • > PHP Warning
      Use of undefined constant AYS_PRG_ADMIN_URL - assumed 'AYS_PRG_ADMIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/portfolio-responsive-gallery/admin/partials/portfolio-responsive-gallery-admin-display.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/portfolio-responsive-gallery/admin/partials/attributes/actions/portfolio-responsive-gallery-attributes-actions.php:42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/portfolio-responsive-gallery/admin/partials/how-to-use/portfolio-responsive-gallery-how-to-use.php:9
    • > PHP Warning
      Use of undefined constant AYS_PRG_ADMIN_URL - assumed 'AYS_PRG_ADMIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/portfolio-responsive-gallery/admin/partials/attributes/portfolio-responsive-gallery-attributes-display.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/portfolio-responsive-gallery/includes/lists/class-portfolio-responsive-gallery-attributes-list-table.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/portfolio-responsive-gallery/admin/partials/actions/portfolio-responsive-gallery-admin-actions.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/portfolio-responsive-gallery/admin/partials/portfolio-responsive-gallery-admin-display.php:24
    • > PHP Warning
      Use of undefined constant AYS_PRG_ADMIN_URL - assumed 'AYS_PRG_ADMIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/portfolio-responsive-gallery/admin/partials/attributes/actions/portfolio-responsive-gallery-attributes-actions.php on line 30

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed: The official readme.txt is a good inspiration

portfolio-responsive-gallery/portfolio-responsive-gallery.php Passed 13 tests

The main file in "Portfolio Responsive Gallery" v. 1.4.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
79 characters long description:
Portfolio plugin for companies, designers, photographers, artists, freelancers.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin14,619 lines of code in 71 files:
LanguageFilesBlank linesComment linesLines of code
CSS151,8951,2697,090
PHP186048653,562
JavaScript223403642,070
LESS64673601,063
PO File26661,500695
SVG800139

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity32.00
▷ Minimum class complexity1.00
▷ Maximum class complexity130.00
Average method complexity3.85
▷ Minimum method complexity1.00
▷ Maximum method complexity87.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods98
▷ Static methods1313.27%
▷ Public methods9192.86%
▷ Protected methods00.00%
▷ Private methods77.14%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
25 PNG files occupy 0.78MB with 0.46MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/css/skins/light/sprite.png14.60KB6.18KB▼ 57.63%
admin/images/logo_final.png27.94KB3.97KB▼ 85.80%
admin/images/ays_pro.png18.67KB4.33KB▼ 76.82%
admin/images/winter_bundle_logo.png25.05KB6.65KB▼ 73.46%
admin/images/youtube.png1.00KB1.19KB0.00%