84% portfolio-block

Code Review | Portfolio Block - Make and display your portfolio in a professional way

WordPress plugin Portfolio Block - Make and display your portfolio in a professional way scored84%from 54 tests.

About plugin

  • Plugin page: portfolio-block
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 26, 2022
  • Latest release: Nov 2, 2023
  • Number of updates: 16
  • Update frequency: every 34.7 days
  • Top authors: charlescormier (93.75%)abuhayat (12.5%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /2,329 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼10.89ms] Passed 4 tests

Server-side resources used by Portfolio Block - Make and display your portfolio in a professional way
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0435.99 ▼5.47
Dashboard /wp-admin3.34 ▼0.0149.70 ▼15.86
Posts /wp-admin/edit.php3.39 ▲0.0345.32 ▼3.11
Add New Post /wp-admin/post-new.php5.95 ▲0.0681.72 ▼19.11
Media Library /wp-admin/upload.php3.27 ▲0.0336.28 ▲2.39

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

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

Browser metrics Passed 4 tests

Portfolio Block - Make and display your portfolio in a professional way: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6814.24 ▼0.481.86 ▲0.0137.67 ▼6.38
Dashboard /wp-admin2,198 ▲175.56 ▼0.1592.56 ▼11.3642.17 ▼1.17
Posts /wp-admin/edit.php2,100 ▼01.99 ▲0.0536.77 ▲0.4533.41 ▼2.60
Add New Post /wp-admin/post-new.php6,200 ▲4,66519.66 ▲1.45928.34 ▲301.0638.92 ▼25.28
Media Library /wp-admin/upload.php1,391 ▼04.21 ▼0.0598.11 ▼2.5441.47 ▲1.43

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • 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
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/portfolio-block/inc/block.php:4
    • > PHP Warning
      Use of undefined constant PFB_PLUGIN_VERSION - assumed 'PFB_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/portfolio-block/dist/editor.asset.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Requires at least: Version not formatted correctly
You can look at the official readme.txt

portfolio-block/index.php 92% from 13 tests

The main file in "Portfolio Block - Make and display your portfolio in a professional way" v. 1.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("portfolio-block.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected309 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
JSON200153
PO File14547108
PHP3121242
JavaScript31114
CSS2022

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin