88% mechmentor-portfolio-widgets-for-elementor

Code Review | MechMentor Portfolio

WordPress plugin MechMentor Portfolio scored 88% from 54 tests.

About plugin

  • Plugin page: mechmentor-portfo...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Aug 16, 2020
  • Latest release: Aug 16, 2020
  • Number of updates: 2
  • Update frequency: every 44.5 days
  • Top authors: mechdev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 152 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼142.70ms] Passed 4 tests

This is a short check of server-side resources used by MechMentor Portfolio
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.0533.26 ▲4.09
Dashboard /wp-admin3.10 ▲0.0545.79 ▲0.05
Posts /wp-admin/edit.php3.22 ▲0.1144.23 ▼5.08
Add New Post /wp-admin/post-new.php5.46 ▲0.0390.26 ▼556.98
Media Library /wp-admin/upload.php3.05 ▲0.0532.01 ▼8.77

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 15 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by MechMentor Portfolio
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,710 ▲11415.97 ▲0.3010.35 ▲2.0646.91 ▼4.97
Dashboard /wp-admin2,970 ▲375.99 ▲0.05134.96 ▼15.05113.69 ▼9.79
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0264.83 ▲0.2489.92 ▲0.99
Add New Post /wp-admin/post-new.php1,872 ▲37219.05 ▲0.58357.25 ▲3.46107.61 ▼5.14
Media Library /wp-admin/upload.php1,810 ▲35.03 ▲0.01141.48 ▼25.29122.65 ▼5.69

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

Smoke tests 50% 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 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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/mechmentor-portfolio-widgets-for-elementor/templates/mpt-portfolio-single.php
  • 16× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to get property 'items_per_page' of non-object in wp-content/plugins/mechmentor-portfolio-widgets-for-elementor/templates/mpt-portfolio-grid.php on line 14
    • > PHP Notice
      Undefined variable: mpt_data in wp-content/plugins/mechmentor-portfolio-widgets-for-elementor/templates/mpt-portfolio-grid.php on line 14
    • > PHP Notice
      Undefined variable: mpt_data in wp-content/plugins/mechmentor-portfolio-widgets-for-elementor/templates/mpt-portfolio-grid.php on line 13
    • > PHP Notice
      Trying to get property 'columns' of non-object in wp-content/plugins/mechmentor-portfolio-widgets-for-elementor/templates/mpt-portfolio-grid.php on line 10
    • > PHP Notice
      Undefined variable: mpt_data in wp-content/plugins/mechmentor-portfolio-widgets-for-elementor/templates/mpt-portfolio-grid.php on line 24
    • > PHP Notice
      Undefined variable: mpt_data in wp-content/plugins/mechmentor-portfolio-widgets-for-elementor/templates/mpt-portfolio-grid.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Plugin' not found in wp-content/plugins/mechmentor-portfolio-widgets-for-elementor/templates/mpt-portfolio-grid.php:107
    • > PHP Notice
      Undefined variable: mpt_data in wp-content/plugins/mechmentor-portfolio-widgets-for-elementor/templates/mpt-portfolio-grid.php on line 10
    • > PHP Notice
      Trying to get property 'enable_infinite_scroll' of non-object in wp-content/plugins/mechmentor-portfolio-widgets-for-elementor/templates/mpt-portfolio-grid.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mpt_load_template() in wp-content/plugins/mechmentor-portfolio-widgets-for-elementor/templates/mpt-portfolio.php:8

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: media, gallery, portfolio, widget, addon...

mechmentor-portfolio-widgets-for-elementor/mechlin-portfolio.php 85% from 13 tests

"MechMentor Portfolio" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("mechmentor-portfolio-widgets-for-elementor.php" instead of "mechlin-portfolio.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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 plugin1,212 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP8117267768
CSS1263317
JavaScript33317127

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity6.00
▷ Minimum class complexity1.00
▷ Maximum class complexity13.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
Methods30
▷ Static methods13.33%
▷ Public methods2273.33%
▷ Protected methods620.00%
▷ Private methods26.67%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin