62% uber-grid

Code Review | WordPress Portfolio Builder - Portfolio Gallery

WordPress plugin WordPress Portfolio Builder - Portfolio Gallery scored62%from 54 tests.

About plugin

  • Plugin page: uber-grid
  • Plugin version: 1.1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.1.1
  • WordPress version: 6.3.1
  • First release: Nov 6, 2019
  • Latest release: Feb 5, 2023
  • Number of updates: 22
  • Update frequency: every 54.0 days
  • Top authors: portfoliohub (100%)

Code review

54 tests

User reviews

54 reviews

Install metrics

6,000+ active /75,873 total downloads

Benchmarks

Plugin footprint 65% 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.27MB] [CPU: ▼7.43ms] Passed 4 tests

An overview of server-side resources used by WordPress Portfolio Builder - Portfolio Gallery
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.2951.05 ▲4.48
Dashboard /wp-admin3.78 ▲0.4753.74 ▼4.19
Posts /wp-admin/edit.php3.81 ▲0.4557.38 ▲2.58
Add New Post /wp-admin/post-new.php5.82 ▼0.0773.75 ▼32.60
Media Library /wp-admin/upload.php3.64 ▲0.4046.43 ▲12.03
Portfolios /wp-admin/admin.php?page=portfolios_pfhub_portfolio3.5529.15
Lightbox Settings /wp-admin/admin.php?page=Options_portfolio_lightbox_styles3.5533.89
Settings /wp-admin/admin.php?page=Options_portfolio_styles3.5527.72

Server storage [IO: ▲3.06MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 193 new files
Database: 2 new tables, 11 new options
New tables
wp_pfhub_portfolio_grids
wp_pfhub_portfolio_images
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
pfhub_portfolio_version
widget_theysaidso_widget
pfhub_portfolio_admin_image_hover_preview
pfhub_portfolio_disable_right_click
pfhub_portfolio_lightbox_type
widget_pfhubportfolio
widget_recent-posts
...

Browser metrics Passed 4 tests

A check of browser resources used by WordPress Portfolio Builder - Portfolio Gallery
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,980 ▲23413.25 ▼1.131.83 ▼0.2741.42 ▼1.97
Dashboard /wp-admin2,380 ▲1955.84 ▲0.89108.08 ▼2.2641.59 ▼4.05
Posts /wp-admin/edit.php2,266 ▲1772.01 ▼0.0037.27 ▼2.8535.62 ▼0.64
Add New Post /wp-admin/post-new.php1,716 ▲18222.57 ▼0.66665.98 ▼28.8254.02 ▲4.49
Media Library /wp-admin/upload.php1,568 ▲1804.12 ▼0.01116.49 ▲12.9649.79 ▲3.76
Portfolios /wp-admin/admin.php?page=portfolios_pfhub_portfolio1,3003.2659.21100.28
Lightbox Settings /wp-admin/admin.php?page=Options_portfolio_lightbox_styles2,6983.6453.8765.92
Settings /wp-admin/admin.php?page=Options_portfolio_styles6,8413.5561.5885.00

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 50% 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 tables detected upon uninstall: 2 tables
    • wp_pfhub_portfolio_images
    • wp_pfhub_portfolio_grids
  • This plugin does not fully uninstall, leaving 11 options in the database
    • pfhub_portfolio_lightbox_type
    • db_upgraded
    • widget_recent-posts
    • pfhub_portfolio_admin_image_hover_preview
    • pfhub_portfolio_version
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_pfhubportfolio
    • pfhub_portfolio_disable_right_click
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_lightbox_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-lb-settings.php+71
    Undefined variable: pfhub_portfolio_get_option
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_lightbox_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-lb-settings.php+71
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+224
    Undefined index: pfhub_portfolio_view0_sortbutton_border_width
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+231
    Undefined index: pfhub_portfolio_view0_sortbutton_border_color
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+261
    Undefined index: pfhub_portfolio_view0_sortbutton_margin
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+471
    Undefined index: pfhub_portfolio_view0_filterbutton_border_width
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+478
    Undefined index: pfhub_portfolio_view0_filterbutton_border_color
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+508
    Undefined index: pfhub_portfolio_view0_filterbutton_margin
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+863
    Undefined index: pfhub_portfolio_view1_filterbutton_border_width
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+870
    Undefined index: pfhub_portfolio_view1_filterbutton_border_color
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+900
    Undefined index: pfhub_portfolio_view1_filterbutton_margin
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+982
    Undefined index: pfhub_portfolio_view1_sortbutton_border_width
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+989
    Undefined index: pfhub_portfolio_view1_sortbutton_border_color
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+1019
    Undefined index: pfhub_portfolio_view1_sortbutton_margin
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+1321
    Undefined index: pfhub_portfolio_view2_sortbutton_border_width
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+1328
    Undefined index: pfhub_portfolio_view2_sortbutton_border_color
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+1358
    Undefined index: pfhub_portfolio_view2_sortbutton_margin
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+1497
    Undefined index: pfhub_portfolio_view2_filterbutton_border_width
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+1504
    Undefined index: pfhub_portfolio_view2_filterbutton_border_color
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+1534
    Undefined index: pfhub_portfolio_view2_filterbutton_margin
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+1949
    Undefined index: pfhub_portfolio_view3_sortbutton_border_width
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+1956
    Undefined index: pfhub_portfolio_view3_sortbutton_border_color
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+1986
    Undefined index: pfhub_portfolio_view3_sortbutton_margin
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+2124
    Undefined index: pfhub_portfolio_view3_filterbutton_border_width
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+2131
    Undefined index: pfhub_portfolio_view3_filterbutton_border_color
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+2161
    Undefined index: pfhub_portfolio_view3_filterbutton_margin
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+2409
    Undefined index: pfhub_portfolio_view4_sortbutton_border_width
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+2416
    Undefined index: pfhub_portfolio_view4_sortbutton_border_color
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+2446
    Undefined index: pfhub_portfolio_view4_sortbutton_margin
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+2583
    Undefined index: pfhub_portfolio_view4_filterbutton_border_width
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+2590
    Undefined index: pfhub_portfolio_view4_filterbutton_border_color
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+2620
    Undefined index: pfhub_portfolio_view4_filterbutton_margin
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+3079
    Undefined index: pfhub_portfolio_view6_sortbutton_border_width
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+3086
    Undefined index: pfhub_portfolio_view6_sortbutton_border_color
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+3116
    Undefined index: pfhub_portfolio_view6_sortbutton_margin
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+3254
    Undefined index: pfhub_portfolio_view6_filterbutton_border_width
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+3261
    Undefined index: pfhub_portfolio_view6_filterbutton_border_color
    • > GET request to /wp-admin/admin.php?page=Options_portfolio_styles
    • > Notice in wp-content/plugins/uber-grid/src/views/admin-settings.php+3291
    Undefined index: pfhub_portfolio_view6_filterbutton_margin

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/uber-grid/src/views/view-content-slider-css.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/uber-grid/src/PortfolioWidget.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/uber-grid/src/ElementorWidget.php:7

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)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 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
5 plugin tags: wordpress portfolio, portfolio gallery, wordpress portfolio plugin, portfolio, portfolio plugin

uber-grid/index.php 77% from 13 tests

"WordPress Portfolio Builder - Portfolio Gallery" version 1.1.7's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Main file name: The principal plugin file should be the same as the plugin slug ("uber-grid.php" instead of "index.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

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
Success! There were no dangerous files found in this plugin23,164 lines of code in 91 files:
LanguageFilesBlank linesComment linesLines of code
PHP4077454312,446
JavaScript241,2455126,359
CSS165423634,150
SVG903198
JSON20011

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity24.38
▷ Minimum class complexity1.00
▷ Maximum class complexity56.00
Average method complexity4.53
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods87
▷ Static methods4551.72%
▷ Public methods8294.25%
▷ Protected methods33.45%
▷ Private methods22.30%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
60 PNG files occupy 0.11MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/admin/delete2.png0.94KB0.93KB▼ 0.73%
assets/images/admin/arrow.dark.png2.09KB0.99KB▼ 52.61%
assets/images/admin/store-prev.png1.58KB0.81KB▼ 48.54%
assets/images/admin/view_list.png0.98KB0.11KB▼ 88.50%
assets/images/5/loading_background.png0.16KB0.15KB▼ 6.02%