79% cpt-ajax-load-more

Code Review | WordPress Ajax Load More and Infinite Scroll

WordPress plugin WordPress Ajax Load More and Infinite Scroll scored79%from 54 tests.

About plugin

  • Plugin page: cpt-ajax-load-more
  • Plugin version: 1.6.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 6.3.1
  • First release: Aug 6, 2020
  • Latest release: Jul 28, 2021
  • Number of updates: 6
  • Update frequency: every 59.5 days
  • Top authors: tushargohel (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

600+ active /7,594 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.52ms] Passed 4 tests

An overview of server-side resources used by WordPress Ajax Load More and Infinite Scroll
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.77 ▼2.40
Dashboard /wp-admin3.34 ▼0.0150.45 ▼16.55
Posts /wp-admin/edit.php3.39 ▲0.0450.18 ▼1.48
Add New Post /wp-admin/post-new.php5.94 ▲0.0695.45 ▼5.64
Media Library /wp-admin/upload.php3.27 ▲0.0437.97 ▲1.64
CPT Ajax Load more /wp-admin/options-general.php?page=cpt-alm-setting-admin3.2434.86

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for WordPress Ajax Load More and Infinite Scroll
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,647 ▲90115.72 ▲1.345.23 ▲3.4439.58 ▼3.92
Dashboard /wp-admin2,966 ▲7756.57 ▲1.71143.14 ▲36.7240.76 ▼0.40
Posts /wp-admin/edit.php2,855 ▲7662.92 ▲0.91106.71 ▲70.3568.21 ▲30.75
Add New Post /wp-admin/post-new.php2,115 ▲59423.87 ▲0.85704.48 ▲24.1635.68 ▼20.86
Media Library /wp-admin/upload.php2,147 ▲7595.92 ▲1.80129.76 ▲12.7342.76 ▼5.39
CPT Ajax Load more /wp-admin/options-general.php?page=cpt-alm-setting-admin1,6293.2360.9125.39

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/cpt-ajax-load-more/includes/admin/views/shortcode-builder.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cpt-ajax-load-more/includes/functions-cpt-alm.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cpt-ajax-load-more/includes/admin/views/shortcode-builder.php:186

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
9 plugin tags: lazy, load more, scroll, lazy load, infinite...

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

"WordPress Ajax Load More and Infinite Scroll" version 1.6.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
82 characters long description:
The simple way to load custom post type with infinite scroll or load more button.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin2,044 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP142591701,201
CSS31831553
JavaScript46128290

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity12.71
▷ Minimum class complexity1.00
▷ Maximum class complexity33.00
Average method complexity2.95
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes114.29%
Methods42
▷ Static methods1330.95%
▷ Public methods3992.86%
▷ Protected methods00.00%
▷ Private methods37.14%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/comment.png0.75KB0.66KB▼ 12.71%
assets/images/user.png1.02KB1.04KB0.00%