10% wp-pjax

Code Review | WP-PJAX

WordPress plugin WP-PJAX scored 10% from 54 tests.

About plugin

  • Plugin page: wp-pjax
  • Plugin version: 0.0.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.5.1
  • WordPress version: 5.8.1
  • First release: Mar 27, 2013
  • Latest release: Apr 3, 2013
  • Number of updates: 28
  • Update frequency: every 1.8 days
  • Top authors: pekz0r (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

50+ active / 3,861 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/wp-pjax/wp-pjax.php+32
    Constant WP_DEBUG already defined

Server metrics [RAM: ▼1.89MB] [CPU: ▼192.84ms] Passed 4 tests

Server-side resources used by WP-PJAX
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /1.74 ▼1.095.23 ▼30.53
Dashboard /wp-admin1.76 ▼1.295.56 ▼49.90
Posts /wp-admin/edit.php1.76 ▼1.345.02 ▼41.21
Add New Post /wp-admin/post-new.php1.76 ▼3.674.63 ▼649.73
Media Library /wp-admin/upload.php1.76 ▼1.245.37 ▼26.03
WP-PJAX /wp-admin/options-general.php?page=pe-wp-pjax1.764.95

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 30 new files
Database: no new tables, 1 new option
New WordPress options
pe_wp_pjax_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP-PJAX
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,710 ▲11415.89 ▼0.0710.60 ▲1.3147.64 ▼3.77
Dashboard /wp-admin2,974 ▲435.94 ▼0.02146.07 ▼7.52107.96 ▼7.13
Posts /wp-admin/edit.php2,746 ▲72.72 ▲0.0168.55 ▼2.1488.93 ▲1.76
Add New Post /wp-admin/post-new.php1,509 ▼10618.60 ▼2.76399.26 ▲84.13109.83 ▲4.40
Media Library /wp-admin/upload.php1,814 ▲665.09 ▲0.11151.60 ▼9.49118.46 ▲0.97
WP-PJAX /wp-admin/options-general.php?page=pe-wp-pjax2,2572.1063.5097.57

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/wp-pjax/wp-pjax.php+32
    Constant WP_DEBUG already defined
  • This plugin does not fully uninstall, leaving 1 option in the database
    • pe_wp_pjax_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/inc/WP-PJAX.php+13
    Constant WP_DEBUG already defined
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > User notice in wp-includes/functions.php+5663
    wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wp-pjax-admin handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+34
    Undefined index: wp-pjax-enable
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/inc/Config.php+146
    Undefined index: wp-pjax-clear-cache
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+61
    Undefined index: wp-pjax-menu-selector
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+68
    Undefined index: wp-pjax-content-selector
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+75
    Undefined index: wp-pjax-menu-active-class
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+124
    Undefined index: wp-pjax-show-toggle
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+100
    Undefined index: wp-pjax-load-timeout
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+134
    Undefined index: wp-pjax-show-notice
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+144
    Undefined index: wp-pjax-show-extended-notice
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+153
    Undefined index: wp-pjax-notice-timeout
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+156
    Undefined index: wp-pjax-notice-sticky
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+199
    Undefined index: wp-pjax-page-cache
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+209
    Undefined index: wp-pjax-browser-page-cache
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+218
    Undefined index: wp-pjax-page-cache-lifetime
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+225
    Undefined index: wp-pjax-page-cache-exceptions
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+233
    Undefined index: wp-pjax-strip-cookies
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+242
    Undefined index: wp-pjax-strip-cookies-list
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+268
    Undefined index: wp-pjax-page-cache-prefetch
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+277
    Undefined index: wp-pjax-page-cache-prefetch-interval
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+284
    Undefined index: wp-pjax-page-cache-prefetch-pages-per-interval
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+291
    Undefined index: wp-pjax-page-cache-prefetch-sitemap-url
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+298
    Undefined index: wp-pjax-page-cache-prefetch-sitemap-refresh-interval
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+306
    Undefined index: wp-pjax-page-cache-prefetch-sitemap-refresh-on-publish
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+384
    Undefined index: wp-pjax-content-fade
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+393
    Undefined index: wp-pjax-content-fade-timeout-in
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=pe-wp-pjax
    • > Notice in wp-content/plugins/wp-pjax/views/configuration.php+400
    Undefined index: wp-pjax-content-fade-timeout-out

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 items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-pjax/views/toggle.php
    • > /wp-content/plugins/wp-pjax/wp-pjax.php
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-pjax/views/configuration.php:9
    • > PHP Warning
      Use of undefined constant WP_PJAX_CONFIG_PREFIX - assumed 'WP_PJAX_CONFIG_PREFIX' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-pjax/inc/WP-PJAX.js.php on line 13
    • > PHP Warning
      Use of undefined constant WP_PJAX_PLUGIN_PATH - assumed 'WP_PJAX_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-pjax/inc/define.php on line 8
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-pjax/inc/WP-PJAX.js.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-pjax/wp-pjax.php:46

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === wp-pjax === )
  • Screenshots: Add images for these screenshots: #1 (The plugin is activated with the loading notices to the right. Check out the load times!), #2 (Admin page.)
The official readme.txt might help

wp-pjax/wp-pjax.php 92% from 13 tests

The principal PHP file in "WP-PJAX" v. 0.0.4.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected2,186 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP135394271,421
JavaScript3132292480
Markdown31100228
CSS2141557

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity14.29
▷ Minimum class complexity2.00
▷ Maximum class complexity28.00
Average method complexity2.90
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods49
▷ Static methods24.08%
▷ Public methods4285.71%
▷ Protected methods00.00%
▷ Private methods714.29%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants13100.00%
▷ Class constants00.00%
▷ Public constants00.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
4 PNG files occupy 0.23MB with 0.12MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png46.82KB27.44KB▼ 41.39%
screenshot-2.png73.39KB31.00KB▼ 57.75%
assets/screenshot-2.png73.39KB31.00KB▼ 57.75%
screenshot-1.png46.82KB27.44KB▼ 41.39%