84% mb-portfolio

Code Review | MB Portfolio

WordPress plugin MB Portfolio scored84%from 54 tests.

About plugin

  • Plugin page: mb-portfolio
  • Plugin version: 1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.6.1
  • WordPress version: 6.3.1
  • First release: Mar 7, 2020
  • Latest release: Feb 8, 2021
  • Number of updates: 21
  • Update frequency: every 16.1 days
  • Top authors: smubeen0786 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /649 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼2.93ms] Passed 4 tests

Analyzing server-side resources used by MB Portfolio
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1149.77 ▲6.41
Dashboard /wp-admin3.40 ▲0.0951.25 ▼1.47
Posts /wp-admin/edit.php3.45 ▲0.0952.69 ▲2.16
Add New Post /wp-admin/post-new.php5.98 ▲0.0989.09 ▼11.88
Media Library /wp-admin/upload.php3.32 ▲0.0939.34 ▼0.54
Portfolio Category /wp-admin/edit-tags.php?taxonomy=mb-portfolio-category&post_type=mb-portfolio3.3235.34
Add New /wp-admin/post-new.php?post_type=mb-portfolio3.4558.36
All Items /wp-admin/edit.php?post_type=mb-portfolio3.3739.35

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

MB Portfolio: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,009 ▲26313.77 ▼0.8512.38 ▲10.3854.68 ▲10.10
Dashboard /wp-admin2,237 ▲495.87 ▼0.04105.95 ▼4.8940.54 ▼3.21
Posts /wp-admin/edit.php2,117 ▲281.99 ▼0.0338.75 ▲0.9135.33 ▲1.13
Add New Post /wp-admin/post-new.php1,559 ▲4023.20 ▲0.12678.39 ▲8.9158.71 ▲5.85
Media Library /wp-admin/upload.php1,413 ▲254.20 ▼0.00104.65 ▼8.5643.65 ▼6.09
Portfolio Category /wp-admin/edit-tags.php?taxonomy=mb-portfolio-category&post_type=mb-portfolio1,3002.1426.7827.57
Add New /wp-admin/post-new.php?post_type=mb-portfolio2,4257.63173.3466.72
All Items /wp-admin/edit.php?post_type=mb-portfolio1,1091.9831.1731.84

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means 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 take a closer look at the following
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mb-portfolio/inc/cpt.php:65
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mb-portfolio/inc/taxonomy.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mb-portfolio/mb-portfolio.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mb-portfolio/inc/meta_field.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/mb-portfolio/inc/shortcode.php:3

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Custom post type for Portfolio.), #2 (screenshot for adding custom link i.e. project website link.), #3 (screenshot to add fa icon for portfolio category.), #4 (screenshot for placing shortcode in the page or post.), #5 (screenshot of final look front-end.)
Please take inspiration from this readme.txt

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

"MB Portfolio" version 1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
120 characters long description:
The stylish portfolio for WordPress. Shortcode [mb_portfolio navigation="true" posts="6" term_id="" pagination="false"].

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
Everything looks great! No dangerous files found in this plugin678 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP67434327
CSS4512306
JavaScript3144745

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/prev.png1.33KB1.59KB0.00%
images/next.png1.32KB1.58KB0.00%
images/close.png0.27KB0.29KB0.00%