94% theme-mentor

Code Review | Theme Mentor

WordPress plugin Theme Mentor scored 94% from 54 tests.

About plugin

  • Plugin page: theme-mentor
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.13-5.2.5
  • WordPress version: 5.8.1
  • First release: Feb 16, 2013
  • Latest release: Feb 12, 2020
  • Number of updates: 11
  • Update frequency: every 232.0 days
  • Top authors: devrix (54.55%)nofearinc (54.55%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active / 4,336 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼141.69ms] Passed 4 tests

A check of server-side resources used by Theme Mentor
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1432.27 ▲11.64
Dashboard /wp-admin3.09 ▲0.0341.73 ▼0.74
Posts /wp-admin/edit.php3.14 ▲0.0344.03 ▼0.94
Add New Post /wp-admin/post-new.php5.45 ▲0.0186.35 ▼562.71
Media Library /wp-admin/upload.php3.03 ▲0.0332.27 ▼2.36
Theme Mentor /wp-admin/themes.php?page=theme_mentor3.0229.22

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Theme Mentor: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲10215.85 ▼0.168.31 ▼0.0946.98 ▲0.52
Dashboard /wp-admin2,972 ▲355.87 ▼0.28137.24 ▼10.11111.94 ▼3.52
Posts /wp-admin/edit.php2,741 ▲52.70 ▲0.0168.18 ▲2.2988.47 ▲1.49
Add New Post /wp-admin/post-new.php1,675 ▲318.76 ▲0.00371.20 ▲20.85103.79 ▼14.51
Media Library /wp-admin/upload.php1,818 ▲85.00 ▲0.00153.55 ▲6.49121.93 ▲2.31
Theme Mentor /wp-admin/themes.php?page=theme_mentor1,0702.0953.4372.34

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Interface 'Theme_Mentor_Executor' not found in wp-content/plugins/theme-mentor/inc/complex/footer-validations.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'Theme_Mentor_Executor' not found in wp-content/plugins/theme-mentor/inc/complex/header-validations.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/theme-mentor/theme-mentor.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/theme-mentor/inc/templates/admin-template.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% 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
Please fix the following attributes: Please take inspiration from this readme.txt

theme-mentor/theme-mentor.php Passed 13 tests

The main file in "Theme Mentor" v. 0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
90 characters long description:
Theme Mentor is a cousing of the Theme-Check plugin getting deeper into the code analysis.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin302 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP690196273
CSS10017
Markdown14012

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity13.60
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity4.50
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods1885.71%
▷ Protected methods00.00%
▷ Private methods314.29%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
2 PNG files occupy 0.23MB with 0.15MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png169.58KB58.11KB▼ 65.73%
screenshot-2.png61.88KB22.58KB▼ 63.51%