73% genius-portfolio

Code Review | Genius Portfolio

WordPress plugin Genius Portfolio scored73%from 54 tests.

About plugin

  • Plugin page: genius-portfolio
  • Plugin version: 1.6.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.8
  • WordPress version: 6.3.1
  • First release: Jul 14, 2021
  • Latest release: Dec 3, 2021
  • Number of updates: 13
  • Update frequency: every 11.0 days
  • Top authors: flailsoft (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /727 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.23MB] [CPU: ▲3.20ms] Passed 4 tests

Analyzing server-side resources used by Genius Portfolio
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2444.52 ▲5.65
Dashboard /wp-admin3.58 ▲0.2856.77 ▲7.68
Posts /wp-admin/edit.php3.65 ▲0.2958.21 ▲11.12
Add New Post /wp-admin/post-new.php6.11 ▲0.2384.00 ▼11.67
Media Library /wp-admin/upload.php3.43 ▲0.2049.03 ▲12.09

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 30 new files
Database: 3 new tables, 7 new options
New tables
wp_genius_portfolio_items
wp_genius_portfolio_tags
wp_genius_portfolio_items_tags
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
genius-portfolio-db-version
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Genius Portfolio
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,021 ▲23519.58 ▲5.236.07 ▲3.9544.74 ▲1.92
Dashboard /wp-admin2,392 ▲2129.21 ▲3.58241.32 ▲149.1851.37 ▲9.53
Posts /wp-admin/edit.php2,347 ▲2509.03 ▲7.0587.16 ▲49.6938.03 ▼1.56
Add New Post /wp-admin/post-new.php1,683 ▲15724.38 ▲1.49528.60 ▼152.9044.57 ▼5.12
Media Library /wp-admin/upload.php1,547 ▲1509.13 ▲4.93125.84 ▲24.6852.43 ▲4.03

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure failed, leaving 3 tables in the database
    • wp_genius_portfolio_items
    • wp_genius_portfolio_tags
    • wp_genius_portfolio_items_tags
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • genius-portfolio-db-version
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, 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
Please fix the following
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/genius-portfolio/php/controller/AbstractController.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/genius-portfolio/php/controller/AbstractController.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/genius-portfolio/php/controller/AbstractController.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/genius-portfolio/php/controller/AbstractController.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/genius-portfolio/php/controller/AbstractController.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/genius-portfolio/php/controller/AbstractController.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function PortfolioGenius\\PortfolioShortcodeInit\\add_shortcode() in wp-content/plugins/genius-portfolio/php/portfolio-shortcode-init.php:6

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 86% 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: wordpress portfolio, gallery, freelance, portfolio builder, portfolio

genius-portfolio/plugin.php 69% from 13 tests

"Genius Portfolio" version 1.6.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 226 characters long)
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("genius-portfolio.php" instead of "plugin.php")
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

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
Good job! No executable or dangerous file extensions detected6,614 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript32811,8005,240
PHP22222129843
CSS3614531

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity5.89
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity1.61
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes9
▷ Abstract classes111.11%
▷ Concrete classes888.89%
▷ Final classes00.00%
Methods76
▷ Static methods79.21%
▷ Public methods4255.26%
▷ Protected methods3242.11%
▷ Private methods22.63%
Functions14
▷ Named functions1178.57%
▷ Anonymous functions321.43%
Constants4
▷ Global constants4100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/icon.png0.57KB0.75KB0.00%