77% custom-content-portfolio

Code Review | Custom Content Portfolio

WordPress plugin Custom Content Portfolio scored77%from 54 tests.

About plugin

  • Plugin page: custom-content-po...
  • Plugin version: 2.1.0
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.8.2
  • WordPress version: 6.3.1
  • First release: Jan 28, 2013
  • Latest release: Sep 29, 2017
  • Number of updates: 13
  • Update frequency: every 131.4 days
  • Top authors: greenshady (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

400+ active /38,405 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
Install script ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼0.17ms] Passed 4 tests

Analyzing server-side resources used by Custom Content Portfolio
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1337.18 ▼2.85
Dashboard /wp-admin3.54 ▲0.2446.66 ▼1.51
Posts /wp-admin/edit.php3.60 ▲0.2448.34 ▼0.85
Add New Post /wp-admin/post-new.php6.09 ▲0.21103.84 ▲8.05
Media Library /wp-admin/upload.php3.40 ▲0.1738.30 ▲4.53
Categories /wp-admin/edit-tags.php?taxonomy=portfolio_category&post_type=portfolio_project3.3934.17
Settings /wp-admin/edit.php?post_type=portfolio_project&page=ccp-settings3.4346.01
Tags /wp-admin/edit-tags.php?taxonomy=portfolio_tag&post_type=portfolio_project3.3933.74
New Project /wp-admin/post-new.php?post_type=portfolio_project3.7260.06
Projects /wp-admin/edit.php?post_type=portfolio_project3.5341.13

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 77 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Custom Content Portfolio: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,842 ▲9613.64 ▼0.731.65 ▼0.3747.31 ▲2.19
Dashboard /wp-admin2,245 ▲544.84 ▼0.06109.21 ▲3.7642.67 ▼3.88
Posts /wp-admin/edit.php2,128 ▲392.03 ▲0.0339.61 ▲3.9135.22 ▼1.14
Add New Post /wp-admin/post-new.php1,546 ▲2717.61 ▼5.58650.52 ▼21.6347.23 ▼9.92
Media Library /wp-admin/upload.php1,430 ▲424.26 ▲0.0699.42 ▲4.1947.23 ▲3.22
Categories /wp-admin/edit-tags.php?taxonomy=portfolio_category&post_type=portfolio_project1,3012.1325.1027.45
Settings /wp-admin/edit.php?post_type=portfolio_project&page=ccp-settings1,7586.73143.8571.55
Tags /wp-admin/edit-tags.php?taxonomy=portfolio_tag&post_type=portfolio_project1,2702.1327.0826.68
New Project /wp-admin/post-new.php?post_type=portfolio_project3,0398.09172.6271.26
Projects /wp-admin/edit.php?post_type=portfolio_project1,2311.9332.1029.26

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 16× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/custom-content-portfolio/admin/butterbean/tmpl/control-checkbox.php
    • > /wp-content/plugins/custom-content-portfolio/admin/butterbean/tmpl/manager.php
    • > /wp-content/plugins/custom-content-portfolio/admin/butterbean/tmpl/control-parent.php
    • > /wp-content/plugins/custom-content-portfolio/admin/butterbean/tmpl/control-color.php
    • > /wp-content/plugins/custom-content-portfolio/admin/butterbean/tmpl/section.php
    • > /wp-content/plugins/custom-content-portfolio/admin/butterbean/tmpl/nav.php
    • > /wp-content/plugins/custom-content-portfolio/admin/butterbean/tmpl/control-select.php
    • > /wp-content/plugins/custom-content-portfolio/admin/butterbean/tmpl/control-multi-avatars.php
    • > /wp-content/plugins/custom-content-portfolio/admin/butterbean/tmpl/control-radio-image.php
    • > /wp-content/plugins/custom-content-portfolio/admin/butterbean/tmpl/control-checkboxes.php
  • 30× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-content-portfolio/inc/functions-meta.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-content-portfolio/inc/functions-capabilities.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/custom-content-portfolio/portfolio.php:164
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-content-portfolio/inc/functions-filters.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'ButterBean_Control' not found in wp-content/plugins/custom-content-portfolio/admin/butterbean/inc/controls/class-control-color.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-content-portfolio/admin/class-project-edit.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'ButterBean_Control' not found in wp-content/plugins/custom-content-portfolio/admin/butterbean/inc/controls/class-control-palette.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-content-portfolio/admin/class-settings.php:38
    • > PHP Fatal error
      Uncaught Error: Class 'ButterBean_Control' not found in wp-content/plugins/custom-content-portfolio/admin/butterbean/inc/controls/class-control-image.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'ButterBean_Control' not found in wp-content/plugins/custom-content-portfolio/admin/butterbean/inc/controls/class-control-checkboxes.php:20

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)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (Projects management admin screen.), #2 (Edit project admin screen.), #3 (Project image media modal.), #4 (Portfolio settings admin screen.), #5 (Screenshot of the portfolio on the front end.)
The official readme.txt might help

custom-content-portfolio/portfolio.php 85% from 13 tests

The main PHP file in "Custom Content Portfolio" ver. 2.1.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("custom-content-portfolio.php" instead of "portfolio.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 142 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin4,064 lines of code in 69 files:
LanguageFilesBlank linesComment linesLines of code
PHP561,2943,7522,951
Markdown71780493
JavaScript4184394361
CSS27012259

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity11.54
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes24
▷ Abstract classes00.00%
▷ Concrete classes24100.00%
▷ Final classes520.83%
Methods190
▷ Static methods52.63%
▷ Public methods17893.68%
▷ Protected methods10.53%
▷ Private methods115.79%
Functions116
▷ Named functions116100.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

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.93MB with 0.57MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png247.66KB97.79KB▼ 60.51%
screenshot-1.png230.03KB81.26KB▼ 64.68%
screenshot-4.png95.59KB42.48KB▼ 55.56%
screenshot-3.png380.14KB138.47KB▼ 63.57%