77% wp-portfolio-gallery

Code Review | WP Portfolio Gallery

WordPress plugin WP Portfolio Gallery scored77%from 54 tests.

About plugin

  • Plugin page: wp-portfolio-gallery
  • Plugin version: 1.2.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Jan 21, 2015
  • Latest release: Aug 19, 2023
  • Number of updates: 8
  • Update frequency: every 391.5 days
  • Top authors: Litonice13 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /6,578 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.79MB] [CPU: ▲1,465.11ms] 50% from 4 tests

An overview of server-side resources used by WP Portfolio Gallery
Please fix the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 1,365.39ms on /wp-admin/post-new.php?post_type=portfolio)
  • Extra CPU: The extra CPU usage should be kept under 200.00ms (currently 1,465.11ms on /wp-admin/post-new.php?post_type=portfolio)
PageMemory (MB)CPU Time (ms)
Home /4.29 ▲0.831,680.63 ▲1,637.68
Dashboard /wp-admin4.23 ▲0.891,672.40 ▲1,609.81
Posts /wp-admin/edit.php4.17 ▲0.811,435.07 ▲1,384.93
Add New Post /wp-admin/post-new.php6.63 ▲0.751,433.76 ▲1,325.47
Media Library /wp-admin/upload.php4.01 ▲0.781,572.86 ▲1,540.23
Categories /wp-admin/edit-tags.php?taxonomy=jwtag&post_type=portfolio4.011,468.59
All Portfolio /wp-admin/edit.php?post_type=portfolio4.121,305.58
Recommended /wp-admin/edit.php?post_type=portfolio&page=wp-portfolio-gallery-recommended-plugins3.981,809.08
Add New /wp-admin/post-new.php?post_type=portfolio4.191,365.39

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 137 new files
Database: no new tables, 13 new options
New WordPress options
jlt_wp_portfolio_notice_ask_for_rating
theysaidso_admin_options
db_upgraded
jlt_wp_portfolio_notice_what_we_collect
jlt_wp_portfolio_sheet_promo_data_hash
widget_recent-posts
jlt_wp_portfolio_sheet_promo_data
jlt_wp_portfolio_notice_subscribe
can_compress_scripts
jlt_wp_portfolio_activation_time
...

Browser metrics Passed 4 tests

WP Portfolio Gallery: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,092 ▲30613.46 ▼1.179.23 ▲7.2838.73 ▼5.83
Dashboard /wp-admin2,366 ▲1865.71 ▲0.0783.98 ▼8.9079.38 ▲32.34
Posts /wp-admin/edit.php2,229 ▲1262.01 ▼0.0036.79 ▼6.3334.87 ▼3.59
Add New Post /wp-admin/post-new.php1,811 ▲27422.48 ▲4.16672.05 ▲18.6562.41 ▼1.88
Media Library /wp-admin/upload.php1,520 ▲1174.36 ▲0.1295.56 ▼2.0979.63 ▲37.17
Categories /wp-admin/edit-tags.php?taxonomy=jwtag&post_type=portfolio1,4102.1830.3834.53
All Portfolio /wp-admin/edit.php?post_type=portfolio1,2122.0037.0631.96
Portfolio Settings /wp-admin/WP_Fortfolio_Gallery.php260.420.0713.10
Recommended /wp-admin/edit.php?post_type=portfolio&page=wp-portfolio-gallery-recommended-plugins1,3071.7128.4129.39
Add New /wp-admin/post-new.php?post_type=portfolio2,4297.69177.79131.24

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 13 options in the database
    • theysaidso_admin_options
    • jlt_wp_portfolio_notice_subscribe
    • widget_theysaidso_widget
    • jlt_wp_portfolio_notice_ask_for_rating
    • db_upgraded
    • jlt_wp_portfolio_notice_what_we_collect
    • can_compress_scripts
    • widget_recent-comments
    • wp_portfolio_gallery_version
    • jlt_wp_portfolio_sheet_promo_data
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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 items
  • 18× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'JLTWPFOLIO\\Inc\\Classes\otifications\\Model\otice' not found in wp-content/plugins/wp-portfolio-gallery/Inc/Classes/Notifications/Subscribe.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'JLTWPFOLIO\\Inc\\Classes\otifications\\Model\otice' not found in wp-content/plugins/wp-portfolio-gallery/Inc/Classes/Notifications/Ask_For_Rating.php:12
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/wp-portfolio-gallery/trunk/inc/easy-blocks.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'JLTWPFOLIO\\Libs\\RowLinks' not found in wp-content/plugins/wp-portfolio-gallery/Inc/Classes/Row_Links.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'JLTWPFOLIO\\Inc\\Classes\otifications\\Model\\Popup' not found in wp-content/plugins/wp-portfolio-gallery/Inc/Classes/Notifications/Upgrade_Notice.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/wp-portfolio-gallery/trunk/inc/class-tgm-plugin-activation.php:2016
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_plugin_active() in wp-content/plugins/wp-portfolio-gallery/trunk/inc/easy-blocks.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'JLTWPFOLIO\\Libs\\Upgrader' not found in wp-content/plugins/wp-portfolio-gallery/Inc/Classes/Upgrade_Plugin.php:12
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/wp-portfolio-gallery/trunk/inc/easy-blocks.php on line 7
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-portfolio-gallery/trunk/inc/easy-blocks.php on line 7

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/WP_Fortfolio_Gallery.php
    • > Network (severe)
    wp-admin/WP_Fortfolio_Gallery.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=portfolio&page=wp-portfolio-gallery-recommended-plugins
    • > Network (severe)
    https://ps.w.org/ultimate-blocks-for-gutenberg/assets/icon-128x128.png - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (Add New Portfolio Item Screenshot - look and feel.), #2 (WP Portfolio Gallery Item Settings), #3 (Output of the Portfolio Gallery Plugin)
The official readme.txt is a good inspiration

wp-portfolio-gallery/wp-portfolio-gallery.php 85% from 13 tests

The main file in "WP Portfolio Gallery" v. 1.2.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Domain Path: The domain path should be prefixed with a forward slash character ("/languages/")
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages/")

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
There were no executable files found in this plugin8,670 lines of code in 53 files:
LanguageFilesBlank linesComment linesLines of code
PHP421,3903,0735,312
JavaScript56534482,073
CSS6225481,285

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity17.81
▷ Minimum class complexity1.00
▷ Maximum class complexity195.00
Average method complexity3.05
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces8
Interfaces0
Traits2
Classes34
▷ Abstract classes411.76%
▷ Concrete classes3088.24%
▷ Final classes13.33%
Methods298
▷ Static methods3712.42%
▷ Public methods27291.28%
▷ Protected methods248.05%
▷ Private methods20.67%
Functions30
▷ Named functions2686.67%
▷ Anonymous functions413.33%
Constants19
▷ Global constants1578.95%
▷ Class constants421.05%
▷ Public constants4100.00%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
59 PNG files occupy 1.57MB with 1.57MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) assets/images/prettyPhoto/default/sprite_x.png1.15KB0.00KB▼ 100.00%
(invalid) trunk/images/prettyPhoto/facebook/contentPatternRight.png0.18KB0.00KB▼ 100.00%
(invalid) trunk/screenshot-3.png1,256.68KB0.00KB▼ 100.00%
(invalid) trunk/images/prettyPhoto/light_square/sprite.png6.08KB0.00KB▼ 100.00%
(invalid) assets/images/prettyPhoto/facebook/contentPatternTop.png0.18KB0.00KB▼ 100.00%