73% ajax-load-more

Code Review | WordPress Infinite Scroll - Ajax Load More

WordPress plugin WordPress Infinite Scroll - Ajax Load More scored 73% from 54 tests.

About plugin

  • Plugin page: ajax-load-more
  • Plugin version: 5.5.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.9
  • WordPress version: 5.9.2
  • First release: Jun 11, 2014
  • Latest release: Mar 7, 2022
  • Number of updates: 542
  • Update frequency: every 5.2 days
  • Top authors: dcooney (100%)

Code review

54 tests

User reviews

266 reviews

Install metrics

50,000+ active / 1,323,069 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.09MB] [CPU: ▼294.55ms] 75% from 4 tests

Server-side resources used by WordPress Infinite Scroll - Ajax Load More
Please take the time to fix the following items
  • CPU: You should keep total CPU usage under 500.00ms (currently 2,858.21ms on /wp-admin/admin.php?page=ajax-load-more-extensions)
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1059.56 ▼5.44
Dashboard /wp-admin3.52 ▲0.1237.07 ▲4.48
Posts /wp-admin/edit.php3.75 ▲0.1139.54 ▼0.13
Add New Post /wp-admin/post-new.php6.99 ▲0.0292.26 ▼1,173.02
Media Library /wp-admin/upload.php3.41 ▲0.1230.54 ▲0.38
Settings /wp-admin/admin.php?page=ajax-load-more3.4330.06
Licenses /wp-admin/admin.php?page=ajax-load-more-licenses3.4743.43
Help /wp-admin/admin.php?page=ajax-load-more-help3.4324.22
Add-ons /wp-admin/admin.php?page=ajax-load-more-add-ons3.4324.39
Repeater Templates /wp-admin/admin.php?page=ajax-load-more-repeaters3.5133.61
Go Pro /wp-admin/admin.php?page=ajax-load-more-go-pro3.4331.23
Shortcode Builder /wp-admin/admin.php?page=ajax-load-more-shortcode-builder3.7539.42
Extensions /wp-admin/admin.php?page=ajax-load-more-extensions3.732,858.21

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 240 new files
Database: 1 new table, 1 new option
New tables
wp_alm
New WordPress options
alm_version

Browser metrics Passed 4 tests

Checking browser requirements for WordPress Infinite Scroll - Ajax Load More
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,882 ▲16015.83 ▲0.545.77 ▼0.982.32 ▼0.35
Dashboard /wp-admin2,978 ▲1246.19 ▲0.02123.84 ▼15.58217.71 ▲15.71
Posts /wp-admin/edit.php2,775 ▲903.12 ▼0.1364.28 ▲2.51141.72 ▼4.39
Add New Post /wp-admin/post-new.php1,826 ▲16526.21 ▲4.52404.64 ▼84.74212.30 ▼1.16
Media Library /wp-admin/upload.php1,782 ▲1035.76 ▲0.30126.31 ▼37.60197.82 ▼22.39
Settings /wp-admin/admin.php?page=ajax-load-more1,8783.0067.40247.17
Licenses /wp-admin/admin.php?page=ajax-load-more-licenses1,3112.8661.83173.26
Help /wp-admin/admin.php?page=ajax-load-more-help1,3942.8673.27215.68
Add-ons /wp-admin/admin.php?page=ajax-load-more-add-ons1,8042.9366.24261.34
Repeater Templates /wp-admin/admin.php?page=ajax-load-more-repeaters2,0113.9381.15314.58
Go Pro /wp-admin/admin.php?page=ajax-load-more-go-pro1,6942.8596.59219.60
Shortcode Builder /wp-admin/admin.php?page=ajax-load-more-shortcode-builder5,4593.57122.45285.29
Extensions /wp-admin/admin.php?page=ajax-load-more-extensions1,4862.8660.69166.26

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
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_alm
  • Zombie WordPress options were found after uninstall: 1 option
    • alm_version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 63× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ALM_TITLE - assumed 'ALM_TITLE' (this will throw an Error in a future version of PHP) in wp-content/plugins/ajax-load-more/admin/views/add-ons.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function alm_get_repeater_type() in wp-content/plugins/ajax-load-more/core/classes/includes/preloaded.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ajax-load-more/admin/views/settings.php:13
    • > PHP Warning
      Use of undefined constant ALM_TITLE - assumed 'ALM_TITLE' (this will throw an Error in a future version of PHP) in wp-content/plugins/ajax-load-more/admin/views/extensions.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ajax-load-more/admin/shortcode-builder/includes/tax-query-options.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_transient() in wp-content/plugins/ajax-load-more/admin/includes/cta/sharing.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function has_action() in wp-content/plugins/ajax-load-more/admin/includes/cta/dyk.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ajax-load-more/admin/includes/cta/reviews.php:1
    • > PHP Notice
      Undefined variable: paging in wp-content/plugins/ajax-load-more/core/classes/includes/preloaded.php on line 20
    • > PHP Notice
      Undefined variable: transition_container_classes in wp-content/plugins/ajax-load-more/core/classes/includes/preloaded.php on line 16

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% 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: Please delete some tags, you are using 12 tag instead of maximum 10
The official readme.txt is a good inspiration

ajax-load-more/ajax-load-more.php Passed 13 tests

The entry point to "WordPress Infinite Scroll - Ajax Load More" version 5.5.2 is a PHP file that has certain tags in its header comment area
75 characters long description:
The ultimate solution to add infinite scroll functionality to your website.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin54,393 lines of code in 179 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript746,0737,51632,660
PHP641,6762,2778,892
Sass22273375,940
CSS55541915,172
HTML1222511,693
SVG20236

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 284)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity56.17
▷ Minimum class complexity2.00
▷ Maximum class complexity291.00
Average method complexity10.19
▷ Minimum method complexity1.00
▷ Maximum method complexity284.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods72
▷ Static methods2838.89%
▷ Public methods6286.11%
▷ Protected methods34.17%
▷ Private methods79.72%
Functions106
▷ Named functions10599.06%
▷ Anonymous functions10.94%
Constants34
▷ Global constants2985.29%
▷ Class constants514.71%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
25 PNG files occupy 0.22MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/bkg-chkbox_off.png1.09KB0.16KB▼ 84.91%
admin/img/icon-search.png2.27KB1.48KB▼ 34.93%
admin/img/bkg-radio_selected.png1.37KB0.55KB▼ 59.67%
admin/img/logos/block-manager.png4.31KB1.87KB▼ 56.54%
admin/img/column-1.png15.05KB0.10KB▼ 99.33%