72% opal-portfolios

Code Review | Opal Portfolio

WordPress plugin Opal Portfolio scored 72% from 54 tests.

About plugin

  • Plugin page: opal-portfolios
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Jan 28, 2019
  • Latest release: Mar 1, 2019
  • Number of updates: 10
  • Update frequency: every 3.5 days
  • Top authors: wpopal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active / 1,542 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼0.77MB] [CPU: ▼171.93ms] Passed 4 tests

An overview of server-side resources used by Opal Portfolio
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.99 ▲0.2750.50 ▲22.82
Dashboard /wp-admin2.88 ▼0.1725.30 ▼17.51
Posts /wp-admin/edit.php2.88 ▼0.2422.04 ▼34.35
Add New Post /wp-admin/post-new.php2.88 ▼2.5523.02 ▼628.82
Media Library /wp-admin/upload.php2.88 ▼0.1225.48 ▼7.03
Opal Portfolio /wp-admin/edit.php?post_type=opal_portfolio2.8824.52
Add New Portfolio /wp-admin/post-new.php?post_type=opal_portfolio2.8826.77
Settings /wp-admin/edit.php?post_type=opal_portfolio&page=portfolio-settings2.8823.27
Portfolio Categories /wp-admin/edit-tags.php?taxonomy=portfolio_cat&post_type=opal_portfolio2.8825.77

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 174 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Opal Portfolio
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,897 ▲26016.92 ▲1.0224.62 ▲15.2958.91 ▲11.10
Dashboard /wp-admin3,033 ▲995.98 ▲0.04144.19 ▼8.28110.27 ▼11.45
Posts /wp-admin/edit.php2,799 ▲602.73 ▲0.0467.80 ▼2.8393.07 ▲0.32
Add New Post /wp-admin/post-new.php1,727 ▲4415.60 ▼3.23376.55 ▼13.50110.24 ▼5.65
Media Library /wp-admin/upload.php1,867 ▲605.06 ▲0.05167.90 ▲10.95123.92 ▲0.14
Opal Portfolio /wp-admin/edit.php?post_type=opal_portfolio1,4782.6572.1479.91
Add New Portfolio /wp-admin/post-new.php?post_type=opal_portfolio3,89011.21315.21165.36
Settings /wp-admin/edit.php?post_type=opal_portfolio&page=portfolio-settings1,2112.4968.6476.90
Portfolio Categories /wp-admin/edit-tags.php?taxonomy=portfolio_cat&post_type=opal_portfolio1,8012.5670.9283.49

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5663
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=portfolio_cat&post_type=opal_portfolio
    • > User notice in wp-includes/functions.php+5663
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

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 take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/opal-portfolios/includes/admin/screens/class-help.php
  • 51× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/opal-portfolios/includes/vendors/cmb2/libraries/includes/types/CMB2_Type_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/opal-portfolios/includes/vendors/cmb2/libraries/includes/types/CMB2_Type_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Opalportfolio_Portfolios' not found in wp-content/plugins/opal-portfolios/templates/single-portfolios/layout-1.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Multicheck' not found in wp-content/plugins/opal-portfolios/includes/vendors/cmb2/libraries/includes/types/CMB2_Type_Taxonomy_Multicheck_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text_Date' not found in wp-content/plugins/opal-portfolios/includes/vendors/cmb2/libraries/includes/types/CMB2_Type_Text_Time.php:13
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/opal-portfolios/includes/vendors/cmb2/custom-fields/upload/media-tpl.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Radio' not found in wp-content/plugins/opal-portfolios/includes/vendors/cmb2/libraries/includes/types/CMB2_Type_Taxonomy_Radio_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Radio' not found in wp-content/plugins/opal-portfolios/includes/vendors/cmb2/libraries/includes/types/CMB2_Type_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller' not found in wp-content/plugins/opal-portfolios/includes/vendors/cmb2/libraries/includes/rest-api/CMB2_REST_Controller_Boxes.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/opal-portfolios/templates/content-data-none.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed: The official readme.txt might help

opal-portfolios/opalportfolio.php 92% from 13 tests

The entry point to "Opal Portfolio" version 1.0.4 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("opal-portfolios.php" instead of "opalportfolio.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected24,774 lines of code in 138 files:
LanguageFilesBlank linesComment linesLines of code
PHP982,7306,48010,545
CSS231,1911,2139,302
SVG2002,718
JavaScript133944771,655
Markdown21880554

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity15.20
▷ Minimum class complexity1.00
▷ Maximum class complexity182.00
Average method complexity3.05
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes88
▷ Abstract classes89.09%
▷ Concrete classes8090.91%
▷ Final classes00.00%
Methods613
▷ Static methods11618.92%
▷ Public methods50582.38%
▷ Protected methods9515.50%
▷ Private methods132.12%
Functions55
▷ Named functions55100.00%
▷ Anonymous functions00.00%
Constants31
▷ Global constants1548.39%
▷ Class constants1651.61%
▷ Public constants16100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
19 PNG files occupy 0.29MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/vendors/cmb2/libraries/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
assets/3rd/lightgallery/img/youtube-play.png2.64KB2.37KB▼ 10.06%
assets/images/menu-icon-red.png1.29KB0.49KB▼ 62.22%
includes/vendors/cmb2/libraries/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
includes/vendors/cmb2/libraries/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%