88% pagli-companion

Code Review | Pagli Companion

WordPress plugin Pagli Companion scored 88% from 54 tests.

About plugin

  • Plugin page: pagli-companion
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7
  • WordPress version: 5.8.1
  • First release: Dec 25, 2017
  • Latest release: Jan 2, 2018
  • Number of updates: 6
  • Update frequency: every 1.5 days
  • Top authors: bnayawpguy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 1,196 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.07MB] [CPU: ▼141.73ms] Passed 4 tests

Server-side resources used by Pagli Companion
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.91 ▲0.1938.66 ▲17.37
Dashboard /wp-admin3.13 ▲0.0843.82 ▼1.96
Posts /wp-admin/edit.php3.18 ▲0.0847.61 ▲3.23
Add New Post /wp-admin/post-new.php5.49 ▲0.0690.57 ▼571.12
Media Library /wp-admin/upload.php3.08 ▲0.0734.07 ▲2.92
All Testimonials /wp-admin/edit.php?post_type=testimonial3.1227.46
All Items /wp-admin/edit.php?post_type=portfolio3.1234.24
Add New /wp-admin/post-new.php?post_type=portfolio3.1849.70
Categories /wp-admin/edit-tags.php?taxonomy=portfolio-category&post_type=portfolio3.0731.86
Add New /wp-admin/post-new.php?post_type=testimonial3.1845.25

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 47 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Pagli Companion
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,762 ▲16616.31 ▲0.808.51 ▼1.9947.70 ▼0.27
Dashboard /wp-admin3,045 ▲1146.04 ▲0.02148.42 ▲3.93116.57 ▲5.97
Posts /wp-admin/edit.php2,814 ▲752.72 ▲0.0065.38 ▼3.2094.67 ▲5.65
Add New Post /wp-admin/post-new.php1,549 ▼13418.62 ▼0.22410.92 ▲26.14104.82 ▼3.46
Media Library /wp-admin/upload.php1,882 ▲755.06 ▲0.04155.45 ▼11.67116.69 ▼7.38
All Testimonials /wp-admin/edit.php?post_type=testimonial1,4712.6460.9876.32
All Items /wp-admin/edit.php?post_type=portfolio1,4902.7661.8174.89
Add New /wp-admin/post-new.php?post_type=portfolio3,0529.06256.65154.74
Categories /wp-admin/edit-tags.php?taxonomy=portfolio-category&post_type=portfolio1,8112.3965.4880.45
Add New /wp-admin/post-new.php?post_type=testimonial2,9088.84240.12140.42

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstall script ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/pagli-companion/widgets/pagli-counter/tpl/default.php
    • > /wp-content/plugins/pagli-companion/pagli-companion.php
  • 27× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      extract() expects parameter 1 to be array, null given in wp-content/plugins/pagli-companion/widgets/pagli-icon-text-block/tpl/layout3.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/pagli-companion/single-portfolio.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/pagli-companion/post-types/testimonial-post-type.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/pagli-companion/widgets/pagli-icon-text-block/tpl/layout3.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/pagli-companion/post-types/portfolio-post-type.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'SiteOrigin_Widget' not found in wp-content/plugins/pagli-companion/widgets/pagli-testimonial-slider/pagli-testimonial-slider.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/pagli-companion/widgets/pagli-icon-text-block/tpl/layout2.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/pagli-companion/widgets/pagli-portfolio-grid/tpl/default.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/pagli-companion/widgets/pagli-blog-carousel/tpl/default.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/pagli-companion/tpl-portfolio.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% 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 need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (screenshot-1.png)
You can look at the official readme.txt

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

The principal PHP file in "Pagli Companion" v. 1.0.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Domain Path: The domain path is invalid: folder "/languages/" does not exist

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
There were no executable files found in this plugin12,148 lines of code in 46 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript113,4482,4409,601
CSS11191631,263
PHP211712391,254
LESS39030

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity3.25
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods36
▷ Static methods00.00%
▷ Public methods36100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin