67% ajax-press

Code Review | Ajax Press - Easily Enable Fast Ajax Navigation

WordPress plugin Ajax Press - Easily Enable Fast Ajax Navigation scored67%from 54 tests.

About plugin

  • Plugin page: ajax-press
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9.3
  • WordPress version: 6.3.1
  • First release: Apr 24, 2022
  • Latest release: Apr 29, 2022
  • Number of updates: 6
  • Update frequency: every 1.2 days
  • Top authors: princeahmed (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

70+ active /1,805 total downloads

Benchmarks

Plugin footprint 65% 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: ▲5.03MB] [CPU: ▲25.87ms] 75% from 4 tests

Analyzing server-side resources used by Ajax Press - Easily Enable Fast Ajax Navigation
It is recommended to improve the following
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.03MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.79 ▲5.3366.76 ▲27.06
Dashboard /wp-admin8.93 ▲5.6278.96 ▲27.04
Posts /wp-admin/edit.php8.93 ▲5.5781.05 ▲31.18
Add New Post /wp-admin/post-new.php9.50 ▲3.61113.06 ▲18.18
Media Library /wp-admin/upload.php8.93 ▲5.7081.61 ▲48.04
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.9360.07

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 178 new files
Database: no new tables, 15 new options
New WordPress options
ajax_press_version
fs_debug_mode
widget_theysaidso_widget
ajax_press_notices
fs_gdpr
ajax_press_install_time
can_compress_scripts
widget_recent-posts
fs_accounts
widget_recent-comments
...

Browser metrics Passed 4 tests

A check of browser resources used by Ajax Press - Easily Enable Fast Ajax Navigation
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,910 ▲12416.92 ▲2.303.71 ▲1.9232.59 ▼7.36
Dashboard /wp-admin2,309 ▲1357.51 ▲1.84215.53 ▲117.9652.14 ▲7.75
Posts /wp-admin/edit.php2,260 ▲1607.13 ▲5.1980.42 ▲39.8044.88 ▲7.53
Add New Post /wp-admin/post-new.php1,587 ▲5923.50 ▲0.52562.51 ▼126.3636.47 ▼16.64
Media Library /wp-admin/upload.php1,605 ▲2029.01 ▲4.85130.44 ▲30.1650.42 ▲3.71
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,1666.7759.7227.93

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
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/ajax-press/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 15 options in the database
    • ajax_press_notices
    • ajax_press_install_time
    • fs_accounts
    • fs_active_plugins
    • ajax_press_theme_config_status
    • widget_recent-comments
    • can_compress_scripts
    • fs_gdpr
    • widget_recent-posts
    • widget_theysaidso_widget
    • ...

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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/ajax-press/includes/class-enqueue.php
    • > /wp-content/plugins/ajax-press/includes/theme-config-notice.php
    • > /wp-content/plugins/ajax-press/includes/class-admin.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/ajax-press/plugin.php:15

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

readme.txt 94% 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:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

ajax-press/plugin.php 92% from 13 tests

Analyzing the main PHP file in "Ajax Press - Easily Enable Fast Ajax Navigation" version 1.0.1
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ajax-press.php" instead of "plugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected31,051 lines of code in 132 files:
LanguageFilesBlank linesComment linesLines of code
PHP1137,36516,10430,810
JavaScript53469198
JSON10027
CSS130016

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
The following items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity81.84
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity4.58
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes50
▷ Abstract classes24.00%
▷ Concrete classes4896.00%
▷ Final classes00.00%
Methods1,163
▷ Static methods18015.48%
▷ Public methods82270.68%
▷ Protected methods151.29%
▷ Private methods32628.03%
Functions94
▷ Named functions94100.00%
▷ Anonymous functions00.00%
Constants129
▷ Global constants10480.62%
▷ Class constants2519.38%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 compressed PNG files occupy 0.16MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/notice.png15.30KB15.94KB0.00%
assets/images/inspect-element.png33.90KB34.75KB0.00%
assets/images/main-content-selector-settings.png14.09KB14.33KB0.00%
assets/images/main-content-selector.png77.06KB81.24KB0.00%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%