84% bt-multi-image-portfolio

Code Review | BT Multi-image Portfolio

WordPress plugin BT Multi-image Portfolio scored84%from 54 tests.

About plugin

  • Plugin page: bt-multi-image-po...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7
  • WordPress version: 6.3.1
  • First release: Nov 9, 2016
  • Latest release: Feb 9, 2017
  • Number of updates: 14
  • Update frequency: every 6.6 days
  • Top authors: bayatree (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /1,641 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.12MB] [CPU: ▼1.82ms] Passed 4 tests

This is a short check of server-side resources used by BT Multi-image Portfolio
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1243.78 ▼2.71
Dashboard /wp-admin3.42 ▲0.1145.19 ▼3.62
Posts /wp-admin/edit.php3.53 ▲0.1748.23 ▲0.40
Add New Post /wp-admin/post-new.php6.01 ▲0.1389.99 ▼1.36
Media Library /wp-admin/upload.php3.34 ▲0.1137.05 ▲4.94
Add Portfolio item /wp-admin/post-new.php?post_type=bayatree-portfolio3.4557.09
Portfolio Categories /wp-admin/edit-tags.php?taxonomy=portfolio-category&post_type=bayatree-portfolio3.3336.05
Settings /wp-admin/edit.php?post_type=bayatree-portfolio&page=portfolio_settings3.3133.03
All Portfolio /wp-admin/edit.php?post_type=bayatree-portfolio3.3835.92

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for BT Multi-image Portfolio
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,992 ▲24614.23 ▼0.4610.47 ▲8.5936.56 ▼7.38
Dashboard /wp-admin2,262 ▲715.10 ▲0.20109.88 ▲5.9040.26 ▲3.37
Posts /wp-admin/edit.php2,150 ▲612.32 ▲0.2642.05 ▲7.4335.07 ▲2.08
Add New Post /wp-admin/post-new.php1,559 ▲1717.94 ▼0.30593.56 ▼31.8033.49 ▼18.88
Media Library /wp-admin/upload.php1,444 ▲564.42 ▲0.0697.35 ▲4.0544.51 ▲3.63
Add Portfolio item /wp-admin/post-new.php?post_type=bayatree-portfolio2,4678.05177.8465.35
Portfolio Categories /wp-admin/edit-tags.php?taxonomy=portfolio-category&post_type=bayatree-portfolio1,3232.0630.4627.78
Settings /wp-admin/edit.php?post_type=bayatree-portfolio&page=portfolio_settings1,3602.6156.0522.44
All Portfolio /wp-admin/edit.php?post_type=bayatree-portfolio1,1192.2432.0528.43

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/bt-multi-image-portfolio/tpl/update_custom_option.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: multi-image portfolio, multiple categories portfolio, free portfolio, portfolio plugin, image gallery...

bt-multi-image-portfolio/index.php 92% from 13 tests

The main PHP file in "BT Multi-image Portfolio" ver. 1.1.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("bt-multi-image-portfolio.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected3,333 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript360811,359
CSS48422736
SVG100685
PHP655153553

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity27.00
▷ Minimum class complexity27.00
▷ Maximum class complexity27.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
8 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/next.png1.32KB1.58KB0.00%
img/close_icon.png29.06KB13.09KB▼ 54.95%
img/controls.png2.19KB0.95KB▼ 56.49%
(invalid) img/close-lightbox1.png4.68KB0.00KB▼ 100.00%
img/link.png1.34KB1.29KB▼ 3.80%