10% portfolio-manager-lite

Code Review | Portfolio Manager Lite

WordPress plugin Portfolio Manager Lite scored10%from 54 tests.

About plugin

  • Plugin page: portfolio-manager...
  • Plugin version: 1.20
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.9
  • WordPress version: 6.3.1
  • First release: Dec 2, 2015
  • Latest release: May 6, 2022
  • Number of updates: 40
  • Update frequency: every 58.8 days
  • Top authors: OTWthemes (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

100+ active /12,728 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/portfolio-manager-lite/classes/otw_pm_image_crop.php+7
    Methods with the same name as their class will not be constructors in a future version of PHP; OTWPMImageCropLite has a deprecated constructor

Server metrics [RAM: ▼1.20MB] [CPU: ▼47.69ms] Passed 4 tests

A check of server-side resources used by Portfolio Manager Lite
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.79 ▼0.689.42 ▼33.90
Dashboard /wp-admin2.81 ▼0.5012.65 ▼39.71
Posts /wp-admin/edit.php2.81 ▼0.5513.00 ▼42.27
Add New Post /wp-admin/post-new.php2.81 ▼3.0816.32 ▼74.89
Media Library /wp-admin/upload.php2.81 ▼0.4212.53 ▼20.49
Options /wp-admin/edit.php?post_type=otw_pm_portfolio&page=otw-pml-settings2.8112.55
Add New List /wp-admin/edit.php?post_type=otw_pm_portfolio&page=otw-pml-add2.8114.42
Portfolio Tags /wp-admin/edit-tags.php?taxonomy=otw_pm_portfolio_tag&post_type=otw_pm_portfolio2.8113.58
License Manager /wp-admin/edit.php?post_type=otw_pm_portfolio&page=otw-pml-lm2.8112.85
otwfcr /wp-admin/admin.php?page=otwfcr2.8113.16
Portfolio Items /wp-admin/edit.php?post_type=otw_pm_portfolio2.8112.33
Duplicated List /wp-admin/admin.php?page=otw-pml-copy2.8113.28
Add New Item /wp-admin/post-new.php?post_type=otw_pm_portfolio2.8111.03
Portfolio Categories /wp-admin/edit-tags.php?taxonomy=otw_pm_portfolio_category&post_type=otw_pm_portfolio2.8114.40
Portfolio Lists /wp-admin/edit.php?post_type=otw_pm_portfolio&page=otw-pml2.8112.59

Server storage [IO: ▲6.12MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 307 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
db_upgraded
otw_pm_portfolio_details
widget_theysaidso_widget
widget_otw_pm_widget_items
can_compress_scripts
otw_pml_rewrite_rules
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Portfolio Manager Lite
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,093 ▲32215.24 ▲0.9334.72 ▲32.6836.58 ▼8.92
Dashboard /wp-admin2,257 ▲725.08 ▼0.78100.48 ▼1.9773.14 ▲33.53
Posts /wp-admin/edit.php2,164 ▲752.36 ▲0.3639.92 ▲3.4635.30 ▼0.48
Add New Post /wp-admin/post-new.php6,407 ▲4,88728.37 ▲5.29879.97 ▲214.8939.69 ▼15.79
Media Library /wp-admin/upload.php1,457 ▲664.48 ▲0.30109.38 ▲3.9447.61 ▲3.57
Options /wp-admin/edit.php?post_type=otw_pm_portfolio&page=otw-pml-settings1,2512.6035.5543.40
Add New List /wp-admin/edit.php?post_type=otw_pm_portfolio&page=otw-pml-add1,8773.1160.0038.66
Portfolio Tags /wp-admin/edit-tags.php?taxonomy=otw_pm_portfolio_tag&post_type=otw_pm_portfolio1,3082.0529.3331.72
License Manager /wp-admin/edit.php?post_type=otw_pm_portfolio&page=otw-pml-lm9841.8926.7426.84
otwfcr /wp-admin/admin.php?page=otwfcr8361.8827.1619.94
Portfolio Items /wp-admin/edit.php?post_type=otw_pm_portfolio1,2012.5734.9130.91
Duplicated List /wp-admin/admin.php?page=otw-pml-copy8331.8827.2619.88
Add New Item /wp-admin/post-new.php?post_type=otw_pm_portfolio2,8867.91185.73154.53
Portfolio Categories /wp-admin/edit-tags.php?taxonomy=otw_pm_portfolio_category&post_type=otw_pm_portfolio1,3391.9430.8828.41
Portfolio Lists /wp-admin/edit.php?post_type=otw_pm_portfolio&page=otw-pml9292.5531.6529.86

Uninstaller [IO: ▲0.14MB] [DB: ▲0.01MB] 50% 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
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/portfolio-manager-lite/classes/otw_pm_image_crop.php+7
    Methods with the same name as their class will not be constructors in a future version of PHP; OTWPMImageCropLite has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 9 options
    • otw_pml_rewrite_rules
    • theysaidso_admin_options
    • widget_otw_pm_widget_items
    • db_upgraded
    • widget_recent-comments
    • otw_pm_portfolio_details
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=otw_pm_portfolio&page=otw-pml
    • > Deprecated in wp-content/plugins/portfolio-manager-lite/classes/otw_pm_image_crop.php+7
    Methods with the same name as their class will not be constructors in a future version of PHP; OTWPMImageCropLite has a deprecated constructor
    • > GET request to /wp-admin/edit.php?post_type=otw_pm_portfolio&page=otw-pml-add
    • > Notice in wp-content/plugins/portfolio-manager-lite/views/otw_portfolio_manager_lite_add_list.php+196
    Undefined variable: nextID
    • > GET request to /wp-admin/admin.php?page=otw-pml-copy
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'OTWPortfolioManagerLite' does not have a method 'pm_copy'
    • > GET request to /wp-admin/post-new.php?post_type=otw_pm_portfolio
    • > Notice in wp-content/plugins/portfolio-manager-lite/views/otw_portfolio_manager_lite_meta_box.php+138
    Undefined variable: media_display
    • > GET request to /wp-admin/post-new.php?post_type=otw_pm_portfolio
    • > Notice in wp-content/plugins/portfolio-manager-lite/views/otw_portfolio_manager_lite_meta_box.php+141
    Undefined variable: media_url

SRP 0% 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
Please fix the following items
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/portfolio-manager-lite/skeleton/wrappers/meta.php
    • > /wp-content/plugins/portfolio-manager-lite/include/otw_components/otw_shortcode/libs/recaptcha-php-1.11/example-mailhide.php
    • > /wp-content/plugins/portfolio-manager-lite/include/otw_components/otw_factory/views/action_message.php
    • > /wp-content/plugins/portfolio-manager-lite/skeleton/components/item_media.php
  • 62× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/portfolio-manager-lite/skeleton/components/title.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/portfolio-manager-lite/skeleton/components/simple_media.php:3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/portfolio-manager-lite/skeleton/components/item_media.php on line 2
    • > PHP Notice
      Trying to get property 'post_content' of non-object in wp-content/plugins/portfolio-manager-lite/skeleton/components/widget_content.php on line 5
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/portfolio-manager-lite/include/content.php:118
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/portfolio-manager-lite/skeleton/components/widget_title.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/portfolio-manager-lite/include/otw_components/otw_factory/views/license_manager.php:3
    • > PHP Notice
      Undefined variable: return_url in wp-content/plugins/portfolio-manager-lite/include/otw_components/otw_factory/views/action_message.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_post_terms() in wp-content/plugins/portfolio-manager-lite/skeleton/components/meta_tags.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/portfolio-manager-lite/include/otw_components/otw_shortcode/widgets/otw_shortcode_widget.class.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
  • Screenshots: Add images for these screenshots: #1 (Grid - Portfolio 1 col), #2 (Grid - Portfolio 4 col), #3 (Image Left - Portfolio 1 column), #4 (Newspaper - Portfolio 3 columns), #5 (Widget Style - Image Left), #6 (Timeline), #7 (Slider), #8 (Carousel 3 columns), #9 (Portfolio Manager menu), #10 (Add new item), #11 (Portfolio items list), #12 (Portfolio categories), #13 (Portfolio tags), #14 (Add portfolio list), #15 (Portfolio lists), #16 (Portfolio options)
You can look at the official readme.txt

portfolio-manager-lite/otw_portfolio_manager_lite.php 85% from 13 tests

The main file in "Portfolio Manager Lite" v. 1.20 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("portfolio-manager-lite.php" instead of "otw_portfolio_manager_lite.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 563 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin30,834 lines of code in 151 files:
LanguageFilesBlank linesComment linesLines of code
CSS341,11242512,579
PHP702,7661,34810,395
JavaScript401,1316014,717
SVG5003,108
XML10018
JSON10017

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity92.06
▷ Minimum class complexity1.00
▷ Maximum class complexity345.00
Average method complexity6.61
▷ Minimum method complexity1.00
▷ Maximum method complexity97.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods276
▷ Static methods186.52%
▷ Public methods20273.19%
▷ Protected methods279.78%
▷ Private methods4717.03%
Functions38
▷ Named functions38100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants14100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
98 PNG files occupy 1.44MB with 0.56MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
include/otw_components/otw_shortcode/images-shortcodes/nivo-default/close@2x.png3.02KB0.34KB▼ 88.83%
include/otw_components/otw_shortcode/images-shortcodes/patterns/dimension.png0.54KB0.57KB0.00%
screenshot-12.png61.20KB22.05KB▼ 63.97%
include/otw_components/otw_shortcode/images/down.png0.61KB0.62KB0.00%
include/otw_components/otw_shortcode/images-shortcodes/icons/flatified/camera.png4.64KB2.68KB▼ 42.19%