68% a3-portfolio

Code Review | a3 Portfolio

WordPress plugin a3 Portfolio scored68%from 54 tests.

About plugin

  • Plugin page: a3-portfolio
  • Plugin version: 3.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Dec 20, 2014
  • Latest release: Nov 23, 2023
  • Number of updates: 157
  • Update frequency: every 20.8 days
  • Top authors: a3rev (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

100+ active /33,113 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲3.61MB] [CPU: ▲18.32ms] Passed 4 tests

Server-side resources used by a3 Portfolio
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /6.96 ▲3.4963.57 ▲20.52
Dashboard /wp-admin7.01 ▲3.6666.07 ▲2.55
Posts /wp-admin/edit.php7.07 ▲3.7074.18 ▲22.42
Add New Post /wp-admin/post-new.php9.55 ▲3.66126.64 ▲29.57
Media Library /wp-admin/upload.php6.87 ▲3.6360.46 ▲27.80
Shortcodes /wp-admin/edit.php?post_type=a3-portfolio&page=a3-portfolio-shortcodes6.8956.74
Portfolio Items /wp-admin/edit.php?post_type=a3-portfolio6.9559.62
Attributes /wp-admin/edit.php?post_type=a3-portfolio&page=portfolio-attributes6.8353.90
Categories /wp-admin/edit-tags.php?taxonomy=portfolio_cat&post_type=a3-portfolio7.0959.14
Add Item /wp-admin/post-new.php?post_type=a3-portfolio7.1585.63
General Settings /wp-admin/edit.php?post_type=a3-portfolio&page=a3-portfolios-settings6.97462.60
Tags /wp-admin/edit-tags.php?taxonomy=portfolio_tag&post_type=a3-portfolio7.0868.57

Server storage [IO: ▲3.16MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 316 new files
Database: 2 new tables, 20 new options
New tables
wp_a3_portfolio_categorymeta
wp_a3_portfolio_attributes
New WordPress options
a3_portfolios_google_font_list
widget_widget_a3_portfolio_tags
portfolio_inner_container_single_main_image_width_reset
db_upgraded
a3_portfolio_global_item_expander_settings
widget_recent-posts
widget_widget_a3_portfolio_categories
can_compress_scripts
a3_portfolios_clean_on_deletion
widget_widget_a3_portfolio_attribute_filter
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for a3 Portfolio
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲9814.72 ▲0.451.75 ▲0.1339.37 ▼5.23
Dashboard /wp-admin2,246 ▲725.59 ▼0.08103.91 ▲5.5348.26 ▲1.81
Posts /wp-admin/edit.php2,154 ▲541.95 ▲0.0141.49 ▼0.1136.01 ▲3.37
Add New Post /wp-admin/post-new.php6,413 ▲4,88728.49 ▲5.33832.59 ▲227.9755.86 ▲6.38
Media Library /wp-admin/upload.php1,451 ▲514.16 ▼0.1194.39 ▼0.3565.29 ▲22.59
Shortcodes /wp-admin/edit.php?post_type=a3-portfolio&page=a3-portfolio-shortcodes1,2693.7466.2528.96
Portfolio Items /wp-admin/edit.php?post_type=a3-portfolio1,1571.9532.9330.71
Attributes /wp-admin/edit.php?post_type=a3-portfolio&page=portfolio-attributes1,0072.0027.3829.94
Categories /wp-admin/edit-tags.php?taxonomy=portfolio_cat&post_type=a3-portfolio1,4582.4646.3136.11
Add Item /wp-admin/post-new.php?post_type=a3-portfolio3,2827.89234.2287.02
General Settings /wp-admin/edit.php?post_type=a3-portfolio&page=a3-portfolios-settings1,9403.7174.61104.92
Tags /wp-admin/edit-tags.php?taxonomy=portfolio_tag&post_type=a3-portfolio1,3062.1229.9032.39

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
Please fix the following items
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_a3_portfolio_attributes
    • wp_a3_portfolio_categorymeta
  • The uninstall procedure has failed, leaving 19 options in the database
    • a3_portfolio_shortcodes_setting
    • a3_portfolio_global_item_expander_settings
    • a3_portfolio_version
    • portfolio_page_id
    • db_upgraded
    • widget_widget_a3_portfolio_attribute_filter
    • can_compress_scripts
    • a3_portfolio_item_posts_settings
    • widget_widget_a3_portfolio_tags
    • widget_recent-comments
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
    • > GET request to /wp-admin/edit.php?post_type=a3-portfolio&page=a3-portfolios-settings
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/a3-portfolio-isotope-addon): failed to open dir: No such file or directory
    • > GET request to /wp-admin/edit.php?post_type=a3-portfolio&page=a3-portfolios-settings
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/a3-portfolio-dynamic-stylesheets-addon): failed to open dir: No such file or directory
    • > GET request to /wp-admin/edit.php?post_type=a3-portfolio&page=a3-portfolios-settings
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/a3-portfolio-item-switcher-addon): failed to open dir: No such file or directory
    • > GET request to /wp-admin/edit.php?post_type=a3-portfolio&page=a3-portfolios-settings
    • > Warning in wp-admin/includes/plugin.php+294
    opendir(wp-content/plugins/a3-portfolio-dynamic-gallery): failed to open dir: No such file or directory

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
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/a3-portfolio/templates/taxonomy-portfolio_cat_divi.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/a3-portfolio/a3-portfolio.php:24

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 Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
9 plugin tags: image portfolio, image showcase, gallery, showcase, photo gallery...

a3-portfolio/a3-portfolio.php Passed 13 tests

The primary PHP file in "a3 Portfolio" version 3.1.2 is used by WordPress to initiate all plugin functionality
117 characters long description:
Creates a beautiful fully mobile responsive, fully customizable, Google images style portfolio to showcase your work.

Code Analysis 97% from 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 detected54,062 lines of code in 243 files:
LanguageFilesBlank linesComment linesLines of code
PHP1004,3844,25817,137
JavaScript732,9302,45116,713
JSON10013,203
CSS343101793,850
LESS17312442,211
PO File1339492789
HTML4194871
SVG114068
Sass21120

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 410)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity42.59
▷ Minimum class complexity1.00
▷ Maximum class complexity801.00
Average method complexity5.22
▷ Minimum method complexity1.00
▷ Maximum method complexity410.00
Code structure
Namespaces17
Interfaces0
Traits0
Classes64
▷ Abstract classes00.00%
▷ Concrete classes64100.00%
▷ Final classes00.00%
Methods634
▷ Static methods223.47%
▷ Public methods45772.08%
▷ Protected methods14322.56%
▷ Private methods345.36%
Functions118
▷ Named functions10992.37%
▷ Anonymous functions97.63%
Constants25
▷ Global constants1768.00%
▷ Class constants832.00%
▷ Public constants8100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
39 PNG files occupy 0.13MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/slider-handle.png2.67KB1.71KB▼ 36.00%
admin/assets/js/chosen/chosen-sprite@2x.png0.72KB0.83KB0.00%
assets/images/a-5-star-rating-would-be-appreciated.png3.38KB1.21KB▼ 64.25%
(invalid) templates/images/no-image-large.png39.75KB0.00KB▼ 100.00%
admin/assets/images/slider-handle1.png1.14KB1.17KB0.00%