68% a3-portfolio

Code Review | a3 Portfolio

WordPress plugin a3 Portfolio scored 68% from 54 tests.

About plugin

  • Plugin page: a3-portfolio
  • Plugin version: 2.10
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.9
  • WordPress version: 5.9.2
  • First release: Dec 20, 2014
  • Latest release: Jan 24, 2022
  • Number of updates: 142
  • Update frequency: every 18.3 days
  • Top authors: a3rev (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

100+ active / 30,432 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲3.46MB] [CPU: ▼276.81ms] Passed 4 tests

A check of server-side resources used by a3 Portfolio
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /6.83 ▲3.3273.82 ▲24.34
Dashboard /wp-admin6.90 ▲3.5055.45 ▲19.83
Posts /wp-admin/edit.php7.15 ▲3.5155.00 ▲15.81
Add New Post /wp-admin/post-new.php10.47 ▲3.50112.21 ▼1,148.17
Media Library /wp-admin/upload.php6.85 ▲3.5538.14 ▲5.28
Categories /wp-admin/edit-tags.php?taxonomy=portfolio_cat&post_type=a3-portfolio6.9541.33
Attributes /wp-admin/edit.php?post_type=a3-portfolio&page=portfolio-attributes6.7639.43
General Settings /wp-admin/edit.php?post_type=a3-portfolio&page=a3-portfolios-settings6.89415.58
Tags /wp-admin/edit-tags.php?taxonomy=portfolio_tag&post_type=a3-portfolio6.9645.84
Portfolio Items /wp-admin/edit.php?post_type=a3-portfolio6.9242.51
Add Item /wp-admin/post-new.php?post_type=a3-portfolio7.1865.16
Shortcodes /wp-admin/edit.php?post_type=a3-portfolio&page=a3-portfolio-shortcodes6.8842.51

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 320 new files
Database: 2 new tables, 14 new options
New tables
wp_a3_portfolio_categorymeta
wp_a3_portfolio_attributes
New WordPress options
widget_widget_a3_portfolio_tags
widget_widget_a3_portfolio_attribute_filter
a3_portfolio_global_settings
a3_portfolio_global_item_expander_settings
a3_portfolios_clean_on_deletion
portfolio_inner_container_single_main_image_width_reset
widget_widget_a3_portfolio_recently_viewed
widget_widget_a3_portfolio_categories
portfolio_page_id
a3_portfolio_item_posts_settings
...

Browser metrics Passed 4 tests

a3 Portfolio: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,868 ▲12415.92 ▲0.265.65 ▼0.282.35 ▲0.01
Dashboard /wp-admin2,956 ▲986.24 ▲0.07115.24 ▼19.97157.13 ▼6.05
Posts /wp-admin/edit.php2,754 ▲603.23 ▼0.0161.69 ▼1.68144.37 ▲5.98
Add New Post /wp-admin/post-new.php1,720 ▼4020.81 ▲3.75441.97 ▲45.04157.78 ▼1.61
Media Library /wp-admin/upload.php1,764 ▲665.50 ▼0.01154.16 ▲8.25184.93 ▼9.25
Categories /wp-admin/edit-tags.php?taxonomy=portfolio_cat&post_type=a3-portfolio1,9604.1087.44145.31
Attributes /wp-admin/edit.php?post_type=a3-portfolio&page=portfolio-attributes1,2832.3755.08126.57
General Settings /wp-admin/edit.php?post_type=a3-portfolio&page=a3-portfolios-settings2,5675.59112.09273.97
Tags /wp-admin/edit-tags.php?taxonomy=portfolio_tag&post_type=a3-portfolio1,6552.7754.13103.75
Portfolio Items /wp-admin/edit.php?post_type=a3-portfolio1,4813.1759.72123.59
Add Item /wp-admin/post-new.php?post_type=a3-portfolio4,39710.99230.66232.88
Shortcodes /wp-admin/edit.php?post_type=a3-portfolio&page=a3-portfolio-shortcodes1,6535.4786.60114.65

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_a3_portfolio_categorymeta
    • wp_a3_portfolio_attributes
  • The uninstall procedure has failed, leaving 13 options in the database
    • widget_widget_a3_portfolio_attribute_filter
    • portfolio_page_id
    • a3_portfolio_item_posts_settings
    • a3_portfolio_global_item_expander_settings
    • a3_portfolios_clean_on_deletion
    • widget_widget_a3_portfolio_categories
    • a3_portfolio_item_cards_settings
    • widget_widget_a3_portfolio_recently_viewed
    • a3_portfolio_global_settings
    • a3_portfolio_version
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/edit.php?post_type=a3-portfolio&page=a3-portfolios-settings
    • > Warning in wp-admin/includes/plugin.php+290
    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+290
    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+290
    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+290
    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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/a3-portfolio/a3-portfolio.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/a3-portfolio/templates/taxonomy-portfolio_cat_divi.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: image gallery, portfolio, showcase, a3 portfolio, photo gallery...

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

The main PHP file in "a3 Portfolio" ver. 2.10 adds more information about the plugin and also serves as the entry point for this plugin
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 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin56,371 lines of code in 244 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript752,9442,49216,870
PHP984,2603,94916,521
JSON10013,203
CSS373261946,022
LESS17309442,194
PO File1339492789
SVG1240723
HTML12029
Sass21120

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
The following items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 412)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity41.71
▷ Minimum class complexity1.00
▷ Maximum class complexity786.00
Average method complexity5.20
▷ Minimum method complexity1.00
▷ Maximum method complexity412.00
Code structure
Namespaces17
Interfaces0
Traits0
Classes62
▷ Abstract classes00.00%
▷ Concrete classes62100.00%
▷ Final classes00.00%
Methods603
▷ Static methods81.33%
▷ Public methods43271.64%
▷ Protected methods14123.38%
▷ Private methods304.98%
Functions112
▷ Named functions10997.32%
▷ Anonymous functions32.68%
Constants22
▷ Global constants1777.27%
▷ Class constants522.73%
▷ Public constants5100.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
39 PNG files occupy 0.13MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/slider-bg-disable.png1.04KB0.14KB▼ 86.45%
assets/css/colorbox/images/border.png0.11KB0.10KB▼ 7.14%
admin/assets/images/ico-delete.png0.13KB0.13KB0.00%
admin/assets/images/slider-container-start.png1.69KB0.70KB▼ 58.32%
assets/css/colorbox/images/ie6/borderTopLeft.png0.21KB0.20KB▼ 4.63%