73% winning-portfolio

Code Review | Winning Portfolio

WordPress plugin Winning Portfolio scored 73% from 54 tests.

About plugin

  • Plugin page: winning-portfolio
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.0-4.8
  • WordPress version: 6.3.1
  • First release: Oct 20, 2016
  • Latest release: Jun 22, 2017
  • Number of updates: 6
  • Update frequency: every 40.8 days
  • Top authors: pressfore (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active / 2,793 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.29MB] [CPU: ▼3.07ms] Passed 4 tests

A check of server-side resources used by Winning Portfolio
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2638.77 ▼12.17
Dashboard /wp-admin3.65 ▲0.3550.38 ▲5.78
Posts /wp-admin/edit.php3.70 ▲0.3550.67 ▼1.96
Add New Post /wp-admin/post-new.php6.17 ▲0.2996.06 ▼3.92
Media Library /wp-admin/upload.php3.51 ▲0.2839.00 ▲7.00
About /wp-admin/edit.php?post_type=wpf-portfolio&page=wpf-about3.4934.40
Add New /wp-admin/post-new.php?post_type=wpf-portfolio3.7054.10
Category /wp-admin/edit-tags.php?taxonomy=wportfolio_category&post_type=wpf-portfolio3.5035.96
Options /wp-admin/edit.php?post_type=wpf-portfolio&page=wpf3.4833.09
Licenses /wp-admin/edit.php?post_type=wpf-portfolio&page=wpf-licencing3.4832.59
All Portfolios /wp-admin/edit.php?post_type=wpf-portfolio3.5536.07
Addons /wp-admin/edit.php?post_type=wpf-portfolio&page=wpf-addons3.4932.13

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Winning Portfolio
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲11313.30 ▼0.991.75 ▼0.0239.73 ▼9.63
Dashboard /wp-admin2,261 ▲735.87 ▼0.0399.57 ▼7.9186.24 ▲45.18
Posts /wp-admin/edit.php2,147 ▲552.01 ▼0.0137.39 ▼5.2534.45 ▲0.53
Add New Post /wp-admin/post-new.php1,721 ▲18824.76 ▲1.73707.27 ▲25.8564.00 ▲8.29
Media Library /wp-admin/upload.php1,440 ▲524.28 ▲0.1696.96 ▼13.9176.13 ▲29.96
About /wp-admin/edit.php?post_type=wpf-portfolio&page=wpf-about9352.1627.9265.37
Add New /wp-admin/post-new.php?post_type=wpf-portfolio2,5597.94169.62141.54
Category /wp-admin/edit-tags.php?taxonomy=wportfolio_category&post_type=wpf-portfolio1,3142.1525.6431.90
Options /wp-admin/edit.php?post_type=wpf-portfolio&page=wpf1,4012.8857.3435.19
Licenses /wp-admin/edit.php?post_type=wpf-portfolio&page=wpf-licencing8742.0428.9426.40
All Portfolios /wp-admin/edit.php?post_type=wpf-portfolio1,1372.2432.7925.94
Addons /wp-admin/edit.php?post_type=wpf-portfolio&page=wpf-addons9362.0326.1439.02

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/winning-portfolio/uninstall.php+19
    Undefined variable: op
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_plugin_active() in wp-content/plugins/winning-portfolio/core/inc/kc_support.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/winning-portfolio/core/inc/vc_support.php:77
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/winning-portfolio/pages/addons.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/winning-portfolio/pages/dashboard.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/winning-portfolio/core/license.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/winning-portfolio/core/license.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
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:
  • Donate link: Please fix this invalid url: ""
The official readme.txt might help

winning-portfolio/main.php 85% from 13 tests

The main PHP file in "Winning Portfolio" ver. 1.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("winning-portfolio.php" instead of "main.php")

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
There were no executable files found in this plugin1,981 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP173326201,397
CSS2725363
JavaScript26165221

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity9.89
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.13
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods71
▷ Static methods22.82%
▷ Public methods71100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 PNG files occupy 0.66MB with 0.38MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo-color-42.png4.71KB2.05KB▼ 56.45%
assets/images/logo-bw.png2.16KB1.06KB▼ 50.81%
assets/images/additions.png300.47KB110.71KB▼ 63.15%
assets/images/masonry.png166.54KB78.32KB▼ 52.97%
assets/images/logo-color-60.png6.82KB2.63KB▼ 61.48%