78% labtheme-companion

Code Review | LabTheme Companion

WordPress plugin LabTheme Companion scored78%from 54 tests.

About plugin

  • Plugin page: labtheme-companion
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.1.1
  • WordPress version: 6.3.1
  • First release: Jan 9, 2019
  • Latest release: May 6, 2019
  • Number of updates: 10
  • Update frequency: every 11.7 days
  • Top authors: labtheme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /681 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲2.17MB] [CPU: ▲15.01ms] Passed 4 tests

Server-side resources used by LabTheme Companion
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.54 ▲2.0852.31 ▲14.16
Dashboard /wp-admin5.51 ▲2.2164.75 ▲12.94
Posts /wp-admin/edit.php5.60 ▲2.2479.14 ▲31.13
Add New Post /wp-admin/post-new.php9.26 ▲3.37111.28 ▲13.12
Media Library /wp-admin/upload.php5.38 ▲2.1555.08 ▲19.83
Add New /wp-admin/post-new.php?post_type=lab-client9.25106.53
Add New /wp-admin/post-new.php?post_type=lab-service9.25109.65
Portfolio Categories /wp-admin/edit-tags.php?taxonomy=lab_portfolio_categories&post_type=lab-portfolio5.4056.17
Client Categories /wp-admin/edit-tags.php?taxonomy=lab_client_categories&post_type=lab-client5.4052.82
Event Categories /wp-admin/edit-tags.php?taxonomy=lab_event_categories&post_type=lab-event5.4054.56
All Teams /wp-admin/edit.php?post_type=lab-team5.4763.99
Service Categories /wp-admin/edit-tags.php?taxonomy=lab_service_categories&post_type=lab-service5.4051.86
Archive Description /wp-admin/edit.php?post_type=lab-portfolio&page=lab-portfolio-description5.4252.55
Testimonial Tag /wp-admin/edit-tags.php?taxonomy=lab_testimonial_tags&post_type=lab-testimonial5.4052.95
All Testimonials /wp-admin/edit.php?post_type=lab-testimonial5.4757.80

Server storage [IO: ▲8.77MB] [DB: ▲0.03MB] Passed 3 tests

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 142 new files
Database: no new tables, 27 new options
New WordPress options
widget_labtheme_instagram_widget
widget_theysaidso_widget
widget_labtheme_description_widget
widget_labtheme_author_bio_widget
widget_labtheme_companion_cta_widget
widget_labtheme_icon_text_widget
widget_labtheme_category_post_widget
widget_labtheme_featured_page_post_widget
widget_recent-posts
widget_labtheme_author_post_widget
...

Browser metrics Passed 4 tests

Checking browser requirements for LabTheme Companion
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /6,702 ▲3,95621.31 ▲7.0020.93 ▲19.4137.39 ▼3.81
Dashboard /wp-admin4,096 ▲1,9056.51 ▲1.65232.24 ▲126.0145.66 ▼0.07
Posts /wp-admin/edit.php5,845 ▲3,7535.77 ▲3.76133.39 ▲95.9437.99 ▲5.03
Add New Post /wp-admin/post-new.php3,516 ▲1,99525.25 ▲2.16789.98 ▲119.3637.81 ▼18.91
Media Library /wp-admin/upload.php4,978 ▲3,5908.72 ▲4.39173.20 ▲65.9945.72 ▲1.45
Add New /wp-admin/post-new.php?post_type=lab-client8,23921.971,010.3339.76
Add New /wp-admin/post-new.php?post_type=lab-service8,19721.78830.7740.11
Portfolio Categories /wp-admin/edit-tags.php?taxonomy=lab_portfolio_categories&post_type=lab-portfolio5,0475.51108.4229.85
Client Categories /wp-admin/edit-tags.php?taxonomy=lab_client_categories&post_type=lab-client5,0505.50109.5130.34
Event Categories /wp-admin/edit-tags.php?taxonomy=lab_event_categories&post_type=lab-event5,0445.53109.9729.75
All Teams /wp-admin/edit.php?post_type=lab-team4,8455.71127.9128.66
Service Categories /wp-admin/edit-tags.php?taxonomy=lab_service_categories&post_type=lab-service5,0475.57108.2730.29
Archive Description /wp-admin/edit.php?post_type=lab-portfolio&page=lab-portfolio-description3,2177.13204.3961.78
Testimonial Tag /wp-admin/edit-tags.php?taxonomy=lab_testimonial_tags&post_type=lab-testimonial4,9935.51114.2429.56
All Testimonials /wp-admin/edit.php?post_type=lab-testimonial4,8455.62124.0628.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 27 options
    • widget_labtheme_recent_post
    • widget_labtheme_featured_page_post_widget
    • widget_labtheme_companion_cta_widget
    • widget_labtheme_author_post_widget
    • widget_labtheme_posts_category_slider_widget
    • widget_labtheme_select_testimonial_widget
    • widget_labtheme_icon_text_widget
    • widget_labtheme_facebook_page_widget
    • widget_labtheme_advertisement_widget
    • theysaidso_admin_options
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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 fix the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/labtheme-companion/public/partials/labtheme-companion-public-display.php
    • > /wp-content/plugins/labtheme-companion/admin/partials/labtheme-companion-admin-display.php
  • 35× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/labtheme-companion/includes/meta-parts/labtheme-lab-testimonial-template.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'LABTC_BASE_PATH/includes/widgets/widget-custom-testimonial.php' (include_path='.:/usr/share/php') in wp-content/plugins/labtheme-companion/includes/widgets/widgets.php on line 5
    • > PHP Warning
      require_once(LABTC_BASE_PATH/includes/widgets/widget-custom-testimonial.php): failed to open stream: No such file or directory in wp-content/plugins/labtheme-companion/includes/widgets/widgets.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/labtheme-companion/includes/widgets/widget-select-testimonial.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/labtheme-companion/includes/meta-parts/labtheme-lab-course-template.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/labtheme-companion/includes/widgets/widget-cta.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/labtheme-companion/includes/widgets/widget-recent-post.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/labtheme-companion/includes/widgets/widget-facebook-page.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/labtheme-companion/includes/meta-parts/labtheme-lab-event-template.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/labtheme-companion/admin/custom/class-labtheme-companion-custom-metabox.php:46

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

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === labtheme-companion === )
You can look at the official readme.txt

labtheme-companion/labtheme-companion.php 92% from 13 tests

The entry point to "LabTheme Companion" version 1.0.2 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 231 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected17,570 lines of code in 86 files:
LanguageFilesBlank linesComment linesLines of code
PHP499001,8827,383
SVG41124,644
CSS141,442293,574
JavaScript19109771,969

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity28.12
▷ Minimum class complexity1.00
▷ Maximum class complexity89.00
Average method complexity5.87
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes32
▷ Abstract classes00.00%
▷ Concrete classes32100.00%
▷ Final classes00.00%
Methods179
▷ Static methods21.12%
▷ Public methods17396.65%
▷ Protected methods10.56%
▷ Private methods52.79%
Functions67
▷ Named functions6698.51%
▷ Anonymous functions11.49%
Constants5
▷ Global constants5100.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
15 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/images/ui-bg_glass_95_fef1ec_1x400.png0.38KB0.15KB▼ 61.54%
public/css/images/btn-prev3.png1.54KB0.50KB▼ 67.79%
admin/css/images/ui-icons_2e83ff_256x240.png4.57KB4.18KB▼ 8.43%
admin/images/ico-delete.png0.70KB0.72KB0.00%
public/css/images/btn-next3.png1.50KB0.47KB▼ 68.79%