84% lcb-portfolio

Code Review | LCB Portfolio

WordPress plugin LCB Portfolio scored84%from 54 tests.

About plugin

  • Plugin page: lcb-portfolio
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.3.1
  • WordPress version: 6.3.1
  • First release: Oct 12, 2015
  • Latest release: Oct 12, 2015
  • Number of updates: 6
  • Update frequency: every 0.5 days
  • Top authors: Silpion (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /889 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.05MB] [CPU: ▼6.15ms] Passed 4 tests

An overview of server-side resources used by LCB Portfolio
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0541.77 ▼0.22
Dashboard /wp-admin3.35 ▲0.0551.89 ▼0.83
Posts /wp-admin/edit.php3.40 ▲0.0547.78 ▼3.36
Add New Post /wp-admin/post-new.php5.93 ▲0.0587.65 ▼18.51
Media Library /wp-admin/upload.php3.27 ▲0.0537.35 ▼1.88
Portfolio /wp-admin/edit.php?post_type=portfolio3.3240.49
Portfolio /wp-admin/options-general.php?page=lcb-portfolio-settings3.2435.20
Add new /wp-admin/post-new.php?post_type=portfolio3.3948.54

Server storage [IO: ▲1.39MB] [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: 12 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for LCB Portfolio
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲6514.47 ▼0.341.68 ▼0.4942.21 ▼5.19
Dashboard /wp-admin2,234 ▲465.81 ▲0.9498.71 ▼13.4738.77 ▼2.19
Posts /wp-admin/edit.php2,120 ▲312.05 ▲0.0534.26 ▼1.6332.52 ▼1.99
Add New Post /wp-admin/post-new.php1,559 ▲3123.22 ▲5.13664.62 ▲53.9853.69 ▼6.02
Media Library /wp-admin/upload.php1,422 ▲344.25 ▲0.03102.29 ▲1.1045.45 ▼0.14
Portfolio /wp-admin/edit.php?post_type=portfolio1,0961.9635.1031.16
Portfolio /wp-admin/options-general.php?page=lcb-portfolio-settings8412.0623.0526.89
Add new /wp-admin/post-new.php?post_type=portfolio2,2647.75172.3565.17

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • 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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/lcb-portfolio/shortcode.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lcb-portfolio/lcb-portfolio.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/lcb-portfolio/portfolio-options.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: image with description, portfolio, external url

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

The entry point to "LCB Portfolio" version 1.1.2 is a PHP file that has certain tags in its header comment area
37 characters long description:
Displays image with short description

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin212 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP32111134
PO File1121745
CSS15033

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.29
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 1.38MB with 0.92MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.PNG1,298.95KB331.94KB▼ 74.45%
screenshot-2.PNG79.76KB23.02KB▼ 71.14%
screenshot-1.PNG35.46KB16.18KB▼ 54.37%