68% portfolio-wp

Code Review | Portfolio Gallery, Product Catalog - Grid KIT Portfolio

WordPress plugin Portfolio Gallery, Product Catalog - Grid KIT Portfolio scored68%from 54 tests.

About plugin

  • Plugin page: portfolio-wp
  • Plugin version: 2.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Mar 19, 2015
  • Latest release: Jul 15, 2023
  • Number of updates: 250
  • Update frequency: every 12.2 days
  • Top authors: wpsofts (66%)miixee (34.4%)

Code review

54 tests

User reviews

297 reviews

Install metrics

10,000+ active /379,732 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.34MB] [CPU: ▼5.45ms] Passed 4 tests

This is a short check of server-side resources used by Portfolio Gallery, Product Catalog - Grid KIT Portfolio
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3436.37 ▲0.48
Dashboard /wp-admin3.67 ▲0.3347.11 ▼14.98
Posts /wp-admin/edit.php3.71 ▲0.3649.54 ▲6.25
Add New Post /wp-admin/post-new.php6.31 ▲0.4283.04 ▼13.53
Media Library /wp-admin/upload.php3.55 ▲0.3240.65 ▲6.30
Teams /wp-admin/admin.php?page=grid-kit-teams3.69299.38
Portfolios /wp-admin/admin.php?page=grid-kit3.6238.66
Product catalogs /wp-admin/admin.php?page=grid-kit-catalogs3.6240.33
Galleries /wp-admin/admin.php?page=grid-kit-galleries3.6239.64
Client logos /wp-admin/admin.php?page=grid-kit-client-logos3.6238.64
Albums /wp-admin/admin.php?page=grid-kit-albums3.6235.78
Sliders /wp-admin/admin.php?page=grid-kit-sliders3.6238.31

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 96 new files
Database: 2 new tables, 8 new options
New tables
wp_crp_portfolios
wp_crp_projects
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
gkit_banners_last_loaded_at
widget_recent-posts
gkit_banners_content
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Portfolio Gallery, Product Catalog - Grid KIT Portfolio: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,134 ▲38814.02 ▼0.5416.51 ▲14.7845.64 ▼1.76
Dashboard /wp-admin2,252 ▲614.91 ▼1.17108.44 ▲3.7039.82 ▼2.16
Posts /wp-admin/edit.php2,135 ▲462.02 ▼0.0340.77 ▲2.0234.59 ▲0.00
Add New Post /wp-admin/post-new.php6,222 ▲4,70226.18 ▲2.94949.08 ▲283.8564.15 ▲11.38
Media Library /wp-admin/upload.php1,434 ▲464.26 ▲0.0694.53 ▼16.6145.35 ▼2.75
Teams /wp-admin/admin.php?page=grid-kit-teams1,2703.6460.1446.73
Portfolios /wp-admin/admin.php?page=grid-kit1,2703.4247.3831.39
Product catalogs /wp-admin/admin.php?page=grid-kit-catalogs1,2733.4842.2130.03
Galleries /wp-admin/admin.php?page=grid-kit-galleries1,2763.4641.9530.97
Client logos /wp-admin/admin.php?page=grid-kit-client-logos1,2763.4741.5931.16
Albums /wp-admin/admin.php?page=grid-kit-albums1,2763.6841.2828.23
Sliders /wp-admin/admin.php?page=grid-kit-sliders1,2733.4742.7931.03

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_crp_projects
    • wp_crp_portfolios
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/portfolio-wp/views/admin/crp-admin-modal-spinner.php
    • > /wp-content/plugins/portfolio-wp/views/front/crp-front.php
    • > /wp-content/plugins/portfolio-wp/views/admin/crp-admin-header.php
  • 23× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      Use of undefined constant CRP_ADMIN_VIEWS_DIR_PATH - assumed 'CRP_ADMIN_VIEWS_DIR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/portfolio-wp/views/admin/crp-admin.php on line 5
    • > PHP Warning
      Use of undefined constant CRP_CLASSES_DIR_PATH - assumed 'CRP_CLASSES_DIR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/portfolio-wp/views/admin/crp-admin-dashboard.php on line 3
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/portfolio-wp/classes/CRPDashboardListTable.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/portfolio-wp/gkit-config.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/portfolio-wp/views/admin/crp-admin-gallery.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'CRPHelper' not found in wp-content/plugins/portfolio-wp/views/admin/crp-header-banner.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/portfolio-wp/views/admin/crp-admin-slider.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'CRPGridType' not found in wp-content/plugins/portfolio-wp/views/front/layouts/crp-front-tiled-layout-lightgallery.php:26
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/portfolio-wp/classes/CRPDashboardListTable.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'CRP_CLASSES_DIR_PATH/CRPDashboardListTable.php' (include_path='.:/usr/share/php') in wp-content/plugins/portfolio-wp/views/admin/crp-admin-dashboard.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: portfolio gallery, portfolio, portfolio plugin, photo gallery, gallery

portfolio-wp/portfolio-wp.php 92% from 13 tests

The entry point to "Portfolio Gallery, Product Catalog - Grid KIT Portfolio" version 2.2.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 158 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin14,745 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript167191,0355,256
CSS174381444,786
PHP239924974,072
SVG300631

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity43.00
Average method complexity3.06
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes1482.35%
▷ Concrete classes317.65%
▷ Final classes00.00%
Methods34
▷ Static methods1647.06%
▷ Public methods3191.18%
▷ Protected methods12.94%
▷ Private methods25.88%
Functions39
▷ Named functions39100.00%
▷ Anonymous functions00.00%
Constants335
▷ Global constants4212.54%
▷ Class constants29387.46%
▷ Public constants293100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
25 PNG files occupy 0.32MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/admin/layouts/layout-square_dark.png16.31KB0.23KB▼ 98.59%
images/admin/layouts/layout-slider.png63.73KB1.78KB▼ 97.20%
images/admin/layouts/layout-masonry.png0.27KB0.28KB0.00%
images/general/glazzed-image-placeholder.png27.91KB4.92KB▼ 82.38%
images/admin/icon_small.png6.81KB4.23KB▼ 37.85%