84% the-pressengine

Code Review | The Pressengine

WordPress plugin The Pressengine scored 84% from 54 tests.

About plugin

  • Plugin page: the-pressengine
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.1
  • WordPress version: 5.8.1
  • First release: Nov 7, 2015
  • Latest release: Dec 3, 2015
  • Number of updates: 5
  • Update frequency: every 7.0 days
  • Top authors: bala223344 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 444 total downloads

Benchmarks

Plugin footprint 83% from 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.69MB] [CPU: ▼138.26ms] Passed 4 tests

This is a short check of server-side resources used by The Pressengine
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.9139.72 ▲15.36
Dashboard /wp-admin3.75 ▲0.7050.06 ▲2.85
Posts /wp-admin/edit.php3.80 ▲0.6950.87 ▲6.42
Add New Post /wp-admin/post-new.php6.11 ▲0.6786.68 ▼566.13
Media Library /wp-admin/upload.php3.69 ▲0.6936.62 ▲3.82

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 1 new option
New WordPress options
json_api_plugin_version

Browser metrics Passed 4 tests

This is an overview of browser requirements for The Pressengine
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,721 ▲12515.93 ▲0.199.33 ▲0.7144.68 ▼3.16
Dashboard /wp-admin2,967 ▲365.93 ▼0.05148.36 ▼5.79113.84 ▲1.87
Posts /wp-admin/edit.php2,739 ▲32.72 ▲0.0165.98 ▼3.5389.08 ▲5.05
Add New Post /wp-admin/post-new.php2,057 ▲47615.89 ▼4.81402.40 ▲6.12106.67 ▼4.24
Media Library /wp-admin/upload.php1,807 ▼05.04 ▲0.02161.37 ▲15.66113.55 ▼5.76

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • json_api_plugin_version

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

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
Please fix the following items
  • 30× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_JSON_CustomPostType' not found in wp-content/plugins/the-pressengine/lib/class-wp-json-pages.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'WP_JSON_Posts' not found in wp-content/plugins/the-pressengine/lib/class-wp-json-media.php:3
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/admin.php): failed to open stream: No such file or directory in wp-content/plugins/the-pressengine/lib/class-wp-json-server.php on line 10
    • > PHP Fatal error
      Uncaught Error: Interface 'WP_JSON_ResponseInterface' not found in wp-content/plugins/the-pressengine/lib/class-wp-json-response.php:3
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/admin.php): failed to open stream: No such file or directory in wp-content/plugins/the-pressengine/lib/wp-json.php on line 26
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHWPINC/class-wp-json-server.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/the-pressengine/lib/wp-json.php on line 29
    • > PHP Warning
      Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in wp-content/plugins/the-pressengine/lib/wp-json.php on line 29
    • > PHP Warning
      include(./wp-load.php): failed to open stream: No such file or directory in wp-content/plugins/the-pressengine/lib/wp-json.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'WP_JSON_Posts' not found in wp-content/plugins/the-pressengine/lib/class-wp-json-customposttype.php:13
    • > PHP Warning
      include_once(ABSPATHWPINC/class-wp-xmlrpc-server.php): failed to open stream: No such file or directory in wp-content/plugins/the-pressengine/lib/wp-json.php on line 27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
8 plugin tags: remote, restrict, dashboard, post, page...

the-pressengine/thepressengine.php 92% from 13 tests

The principal PHP file in "The Pressengine" v. 1.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("the-pressengine.php" instead of "thepressengine.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin2,969 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP189461,8442,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.43
Average class complexity31.40
▷ Minimum class complexity1.00
▷ Maximum class complexity128.00
Average method complexity4.17
▷ Minimum method complexity1.00
▷ Maximum method complexity53.00
Code structure
Namespaces0
Interfaces3
Traits0
Classes12
▷ Abstract classes216.67%
▷ Concrete classes1083.33%
▷ Final classes00.00%
Methods151
▷ Static methods10.66%
▷ Public methods11576.16%
▷ Protected methods3623.84%
▷ Private methods00.00%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants19
▷ Global constants631.58%
▷ Class constants1368.42%
▷ Public constants13100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin