78% gs-portfolio

Code Review | WordPress Portfolio Plugin - A Plugin for Making Filterable Portfolio Grid, Portfolio Slider and more

WordPress plugin WordPress Portfolio Plugin - A Plugin for Making Filterable Portfolio Grid, Portfolio Slider and more scored78%from 54 tests.

About plugin

  • Plugin page: gs-portfolio
  • Plugin version: 1.6.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.3
  • WordPress version: 6.3.1
  • First release: Jul 15, 2015
  • Latest release: Aug 29, 2023
  • Number of updates: 75
  • Update frequency: every 39.6 days
  • Top authors: samdani (100%)

Code review

54 tests

User reviews

34 reviews

Install metrics

300+ active /28,004 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.52MB] [CPU: ▲1.17ms] 75% from 4 tests

This is a short check of server-side resources used by WordPress Portfolio Plugin - A Plugin for Making Filterable Portfolio Grid, Portfolio Slider and more
Please have a look at the following items
  • CPU: Total CPU usage must kept under 500.00ms (currently 648.26ms on /wp-admin/edit.php?post_type=gs-portfolio&page=gs-portfolio-plugins-premium)
PageMemory (MB)CPU Time (ms)
Home /3.97 ▲0.5140.51 ▼0.24
Dashboard /wp-admin3.88 ▲0.5853.34 ▼4.75
Posts /wp-admin/edit.php3.93 ▲0.5759.71 ▲15.35
Add New Post /wp-admin/post-new.php6.40 ▲0.5194.16 ▲1.27
Media Library /wp-admin/upload.php3.71 ▲0.4941.20 ▲8.39
Portfolio Settings /wp-admin/edit.php?post_type=gs-portfolio&page=portfolio-settings3.7038.87
GS Plugins Lite /wp-admin/edit.php?post_type=gs-portfolio&page=gs-portfolio-plugins-lite3.99634.24
GS Plugins Pro /wp-admin/edit.php?post_type=gs-portfolio&page=gs-portfolio-plugins-premium3.87648.26
Help & Usage /wp-admin/edit.php?post_type=gs-portfolio&page=gs-portfolio-plugins-help3.7138.65
All Portfolios /wp-admin/edit.php?post_type=gs-portfolio3.8443.37
Add New Portfolio /wp-admin/post-new.php?post_type=gs-portfolio3.8949.26

Server storage [IO: ▲1.48MB] [DB: ▲0.04MB] Passed 3 tests

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 42 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
gs_p_advance
gs_p_general

Browser metrics Passed 4 tests

A check of browser resources used by WordPress Portfolio Plugin - A Plugin for Making Filterable Portfolio Grid, Portfolio Slider and more
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,151 ▲39015.52 ▲0.997.88 ▲6.1937.28 ▼8.64
Dashboard /wp-admin2,436 ▲2566.65 ▲0.81109.06 ▲11.6490.95 ▲47.15
Posts /wp-admin/edit.php2,379 ▲2793.83 ▲1.8861.20 ▲24.4266.23 ▲32.31
Add New Post /wp-admin/post-new.php1,699 ▲17322.72 ▼0.42616.72 ▼86.75172.86 ▲111.61
Media Library /wp-admin/upload.php1,522 ▲1224.54 ▲0.3995.14 ▼7.9777.76 ▲33.60
Portfolio Settings /wp-admin/edit.php?post_type=gs-portfolio&page=portfolio-settings1,6676.03123.3669.35
GS Plugins Lite /wp-admin/edit.php?post_type=gs-portfolio&page=gs-portfolio-plugins-lite2,7573.3641.17175.61
GS Plugins Pro /wp-admin/edit.php?post_type=gs-portfolio&page=gs-portfolio-plugins-premium2,4223.3442.0099.59
Help & Usage /wp-admin/edit.php?post_type=gs-portfolio&page=gs-portfolio-plugins-help1,1583.3244.3437.45
All Portfolios /wp-admin/edit.php?post_type=gs-portfolio1,3123.6744.6826.59
Add New Portfolio /wp-admin/post-new.php?post_type=gs-portfolio2,3758.04167.4164.54

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • gs_p_advance
    • widget_theysaidso_widget
    • gs_p_general
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 15× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/gs-portfolio/gsportfolio-files/gs-common-pages/gs-portfolio-common-pages.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/gs-portfolio/gs-portfolio.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gs-portfolio/gsportfolio-files/includes/gs-portfolio-cpt.php:46
    • > PHP Fatal error
      Uncaught Error: Class 'GS_portfolio_WeDevs_Settings_API' not found in wp-content/plugins/gs-portfolio/gsportfolio-files/admin/gs_portfolio_options_config.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function gs_p_get_option() in wp-content/plugins/gs-portfolio/gsportfolio-files/includes/templates/gs_portfolio_structure_one.php:4
    • > PHP Warning
      Use of undefined constant GSPORTFOLIO_FILES_DIR - assumed 'GSPORTFOLIO_FILES_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/gs-portfolio/gsportfolio-files/includes/gs-portfolio-root.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function gs_p_get_option() in wp-content/plugins/gs-portfolio/gsportfolio-files/includes/templates/gs_portfolio_sthree_kira.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gs-portfolio/gsportfolio-files/gs-portfolio-script.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gs-portfolio/gsportfolio-files/includes/gs-portfolio-metabox.php:14
    • > PHP Warning
      require_once(GSPORTFOLIO_FILES_DIR/includes/gs-portfolio-cpt.php): failed to open stream: No such file or directory in wp-content/plugins/gs-portfolio/gsportfolio-files/includes/gs-portfolio-root.php on line 4

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/edit.php?post_type=gs-portfolio&page=portfolio-settings
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/edit.php?post_type=gs-portfolio&page=portfolio-settings
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: portfolio grid, wordpress portfolio plugin, best portfolio plugin wordpress, portfolio slider, filterable portfolio

gs-portfolio/gs-portfolio.php 85% from 13 tests

The main file in "WordPress Portfolio Plugin - A Plugin for Making Filterable Portfolio Grid, Portfolio Slider and more" v. 1.6.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 299 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected7,960 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
CSS72711163,258
PHP198689573,255
SVG300571
Sass11016521
JavaScript412291334
JSON10021

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity36.71
▷ Minimum class complexity3.00
▷ Maximum class complexity70.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods138
▷ Static methods10.72%
▷ Public methods10475.36%
▷ Protected methods64.35%
▷ Private methods2820.29%
Functions45
▷ Named functions4395.56%
▷ Anonymous functions24.44%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
gsportfolio-files/assets/img/icon-128x128.png15.29KB6.64KB▼ 56.55%