10% engap

Code Review | enGap

WordPress plugin enGap scored10%from 54 tests.

About plugin

  • Plugin page: engap
  • Plugin version: 0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.4
  • WordPress version: 6.3.1
  • First release: Dec 14, 2015
  • Latest release: Apr 16, 2016
  • Number of updates: 32
  • Update frequency: every 3.9 days
  • Top authors: enRaiser (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,646 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/engap/lib/class-engap-customposttype.php+113
    Declaration of ENGAP_CustomPostType::get_posts($filter = Array, $context = 'view', $type = NULL, $page = 1) should be compatible with ENGAP_Posts::get_posts($filter = Array, $context = 'view', $type = 'post', $page = 1, $limit = 3)

Server metrics [RAM: ▼1.86MB] [CPU: ▼46.83ms] Passed 4 tests

A check of server-side resources used by enGap
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.405.56 ▼30.63
Dashboard /wp-admin2.16 ▼1.1410.00 ▼35.81
Posts /wp-admin/edit.php2.16 ▼1.196.48 ▼40.62
Add New Post /wp-admin/post-new.php2.16 ▼3.725.78 ▼78.68
Media Library /wp-admin/upload.php2.16 ▼1.065.41 ▼32.21

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 7 new options
New WordPress options
engap_plugin_version
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by enGap
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲5413.44 ▼0.841.91 ▼0.1242.32 ▼2.06
Dashboard /wp-admin2,209 ▲184.86 ▼0.03103.31 ▲2.4639.09 ▼1.99
Posts /wp-admin/edit.php2,092 ▲32.00 ▼0.0338.29 ▼3.7434.56 ▼1.77
Add New Post /wp-admin/post-new.php1,538 ▼12923.24 ▲0.89699.92 ▲44.5654.82 ▲10.03
Media Library /wp-admin/upload.php1,391 ▲64.22 ▲0.0194.30 ▼6.4843.55 ▼2.46

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/engap/lib/class-engap-customposttype.php+113
    Declaration of ENGAP_CustomPostType::get_posts($filter = Array, $context = 'view', $type = NULL, $page = 1) should be compatible with ENGAP_Posts::get_posts($filter = Array, $context = 'view', $type = 'post', $page = 1, $limit = 3)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
The following issues need your attention
  • 10× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/engap/page/index.php
    • > /wp-content/plugins/engap/page/page/listview.php
    • > /wp-content/plugins/engap/page/blog.php
    • > /wp-content/plugins/engap/page/post/listview.php
    • > /wp-content/plugins/engap/page/post/fullview.php
    • > /wp-content/plugins/engap/page/pages.php
    • > /wp-content/plugins/engap/page/more.php
    • > /wp-content/plugins/engap/page/portfolio.php
    • > /wp-content/plugins/engap/page/products.php
    • > /wp-content/plugins/engap/page/page/fullview.php
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/admin.php' (include_path='.:/usr/share/php') in wp-content/plugins/engap/lib/class-engap-server.php on line 10
    • > ID =
    • > PHP Fatal error
      Uncaught Error: Class 'ENGAP_CustomPostType' not found in wp-content/plugins/engap/lib/class-engap-pages.php:21
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/engap/lib/class-engap-server.php on line 10
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/admin.php' (include_path='.:/usr/share/php') in wp-content/plugins/engap/lib/class-engap-server.php on line 10
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/admin.php): failed to open stream: No such file or directory in wp-content/plugins/engap/lib/class-engap-server.php on line 10
    • > PHP Fatal error
      Uncaught Error: Interface 'ENGAP_ResponseInterface' not found in wp-content/plugins/engap/lib/class-engap-response.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'ENGAP_Posts' not found in wp-content/plugins/engap/lib/class-engap-customposttype.php:13
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/admin.php): failed to open stream: No such file or directory in wp-content/plugins/engap/lib/class-engap-server.php on line 10
    • > ID =

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (46 tag instead of maximum 10)
Please take inspiration from this readme.txt

engap/plugin.php 92% from 13 tests

"enGap" version 0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("engap.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,459 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP174589711,458
CSS1301
JavaScript1320

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity23.50
▷ Minimum class complexity1.00
▷ Maximum class complexity78.00
Average method complexity3.81
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces2
Traits0
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes00.00%
Methods69
▷ Static methods00.00%
▷ Public methods5782.61%
▷ Protected methods1217.39%
▷ Private methods00.00%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants16
▷ Global constants318.75%
▷ Class constants1381.25%
▷ Public constants13100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected