10% portfolio-and-testimonial-manager

Code Review | Portfolio and Testimonial manager

WordPress plugin Portfolio and Testimonial manager scored 10% from 54 tests.

About plugin

  • Plugin page: portfolio-and-tes...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-3.9.1
  • WordPress version: 5.9.2
  • First release: Jul 18, 2014
  • Latest release: Oct 11, 2014
  • Number of updates: 12
  • Update frequency: every 7.3 days
  • Top authors: Media6 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 2,876 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/portfolio-and-testimonial-manager/custom-post-type.php+13
    Constant SCRIPT_DEBUG already defined

Server metrics [RAM: ▼2.42MB] [CPU: ▼336.71ms] Passed 4 tests

This is a short check of server-side resources used by Portfolio and Testimonial manager
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.95 ▼1.575.34 ▼48.59
Dashboard /wp-admin1.97 ▼1.445.07 ▼28.36
Posts /wp-admin/edit.php1.97 ▼1.675.29 ▼30.64
Add New Post /wp-admin/post-new.php1.97 ▼5.005.42 ▼1,239.23
Media Library /wp-admin/upload.php1.97 ▼1.334.93 ▼20.09
Settings /wp-admin/edit.php?post_type=portfolio&page=portfolio-settings1.975.14
Settings /wp-admin/admin.php?page=portfolio-settings&page=portfolio-settings1.975.98
Portfolios & Testimonials /wp-admin/edit.php?post_type=portfolio1.975.28
Categories /wp-admin/edit-tags.php?taxonomy=portfolio-category&post_type=portfolio1.975.80

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 25 new files
Database: 3 new tables, no new options
New tables
wp_portfolio_to_category
wp_portfolio_images
wp_portfolio_settings

Browser metrics Passed 4 tests

Checking browser requirements for Portfolio and Testimonial manager
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,032 ▲27817.01 ▲1.2212.33 ▲5.9316.94 ▲14.32
Dashboard /wp-admin2,946 ▲856.14 ▼0.09124.17 ▼8.67181.32 ▲19.85
Posts /wp-admin/edit.php2,716 ▲253.23 ▼0.1267.15 ▲2.40141.66 ▲1.31
Add New Post /wp-admin/post-new.php1,657 ▼10118.04 ▼3.52345.61 ▼106.12174.60 ▲15.44
Media Library /wp-admin/upload.php1,751 ▲535.58 ▲0.06124.46 ▼16.64205.76 ▲23.32
Settings /wp-admin/edit.php?post_type=portfolio&page=portfolio-settings1,1532.7456.22102.77
Settings /wp-admin/admin.php?page=portfolio-settings&page=portfolio-settings1,1522.8161.8893.78
Portfolios & Testimonials /wp-admin/edit.php?post_type=portfolio1,3923.2163.10117.83
Categories /wp-admin/edit-tags.php?taxonomy=portfolio-category&post_type=portfolio1,6873.1757.10133.54

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/portfolio-and-testimonial-manager/custom-post-type.php+13
    Constant SCRIPT_DEBUG already defined

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=portfolio-category&post_type=portfolio
    • > Notice in wp-content/plugins/portfolio-and-testimonial-manager/custom-post-type.php+13
    Constant SCRIPT_DEBUG already defined
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=portfolio-category&post_type=portfolio
    • > Notice in wp-content/plugins/portfolio-and-testimonial-manager/portfolio.php+97
    Undefined variable: labels
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=portfolio-settings&page=portfolio-settings
    • > User deprecated in wp-includes/functions.php+5326
    screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=portfolio-settings&page=portfolio-settings
    • > User deprecated in wp-includes/functions.php+5326
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=portfolio-settings&page=portfolio-settings
    • > Notice in wp-content/plugins/portfolio-and-testimonial-manager/portfolio-settings.php+52
    Undefined index: submit
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=portfolio-settings&page=portfolio-settings
    • > Warning in wp-content/plugins/portfolio-and-testimonial-manager/portfolio-settings.php+93
    Use of undefined constant id - assumed 'id' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=portfolio-settings&page=portfolio-settings
    • > Notice in wp-content/plugins/portfolio-and-testimonial-manager/portfolio-settings.php+93
    Undefined index: id
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=portfolio-settings&page=portfolio-settings
    • > Notice in wp-content/plugins/portfolio-and-testimonial-manager/portfolio-settings.php+94
    Undefined variable: FeeMsg
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=portfolio-category&post_type=portfolio
    • > Notice in wp-content/plugins/portfolio-and-testimonial-manager/portfolio.php+283
    Undefined index: page

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
Please fix the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/portfolio-and-testimonial-manager/custom-post-type.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/portfolio-and-testimonial-manager/portfolio.php:32

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 on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === portfolio-and-testimonial-manager === )
The official readme.txt is a good inspiration

portfolio-and-testimonial-manager/portfolio.php 92% from 13 tests

The main PHP script in "Portfolio and Testimonial manager" version 1.0 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("portfolio-and-testimonial-manager.php" instead of "portfolio.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected1,890 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP517376886
JavaScript4271310841
CSS3314163

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.26
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%
Functions35
▷ Named functions35100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
9 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/back.png0.14KB0.10KB▼ 27.59%
img/wleft.png1.02KB0.79KB▼ 23.04%
img/icon-open.png0.84KB0.70KB▼ 16.08%
img/bright.png1.11KB0.88KB▼ 21.04%
img/bleft.png1.11KB0.87KB▼ 21.41%