77% ajax-load-more-post

Code Review | Ajax Load More - WordPress infinite scroll

WordPress plugin Ajax Load More - WordPress infinite scroll scored 77% from 54 tests.

About plugin

  • Plugin page: ajax-load-more-post
  • Plugin version: 2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.1
  • WordPress version: 5.9.2
  • First release: Aug 16, 2016
  • Latest release: Jun 23, 2019
  • Number of updates: 18
  • Update frequency: every 58.0 days
  • Top authors: ikhodal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 3,031 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.26MB] [CPU: ▲4,142.01ms] 50% from 4 tests

Server-side resources used by Ajax Load More - WordPress infinite scroll
Please have a look at the following items
  • CPU: The total CPU usage must kept under 500.00ms (currently 4,368.08ms on /wp-admin/edit.php?post_type=rplg_view&page=richpostslistandgrid_settings)
  • Extra CPU: Extra CPU usage should be kept under 200.00ms (currently 4,142.01ms on /wp-admin/edit.php?post_type=rplg_view&page=richpostslistandgrid_settings)
PageMemory (MB)CPU Time (ms)
Home /4.21 ▲0.694,658.84 ▲4,600.33
Dashboard /wp-admin4.05 ▲0.644,542.70 ▲4,503.95
Posts /wp-admin/edit.php4.30 ▲0.654,592.46 ▲4,548.62
Add New Post /wp-admin/post-new.php3.94 ▼3.044,376.39 ▲2,915.13
Media Library /wp-admin/upload.php4.00 ▲0.704,728.47 ▲4,695.98
Add New Shortcode /wp-admin/post-new.php?post_type=rplg_view3.943,960.77
All /wp-admin/edit.php?post_type=rplg_view4.064,013.64
License Key /wp-admin/edit.php?post_type=rplg_view&page=richpostslistandgrid_settings3.984,368.08

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ajax Load More - WordPress infinite scroll
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,901 ▲14714.41 ▼1.1718.94 ▲11.333.19 ▲0.71
Dashboard /wp-admin2,978 ▲1206.12 ▼0.08123.76 ▼5.80200.22 ▲37.71
Posts /wp-admin/edit.php2,776 ▲913.28 ▲0.0565.92 ▲2.17141.73 ▲2.87
Add New Post /wp-admin/post-new.php2,110 ▲33719.70 ▼2.41445.55 ▼5.85215.18 ▲25.48
Media Library /wp-admin/upload.php1,786 ▲855.58 ▼0.02143.81 ▲0.46172.54 ▼46.44
Add New Shortcode /wp-admin/post-new.php?post_type=rplg_view5,3384.80115.52175.96
All /wp-admin/edit.php?post_type=rplg_view1,4983.5063.82130.30
License Key /wp-admin/edit.php?post_type=rplg_view&page=richpostslistandgrid_settings1,1983.1559.38143.69

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 1 option in the database
    • widget_ajaxpostloadmoreadmin

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_widget_title
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_number_of_post_display
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_title_text_color
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_header_text_color
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_header_background_color
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_tp_widget_width
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+268
    Undefined index: nm_hide_widget_title
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+268
    Trying to access array offset on value of type null
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+268
    Undefined index: nm_hide_searchbox
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_template
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+268
    Undefined index: nm_hide_post_title
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_post_type
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_category_type
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+270
    Undefined index: nm_category_id
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Warning in wp-content/plugins/ajax-load-more-post/include/shortcode.php+270
    count(): Parameter must be an array or an object that implements Countable
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+268
    Undefined index: nm_rplg_enable_rtl
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+268
    Undefined index: nm_rplg_enable_post_count
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+268
    Undefined index: nm_rplg_hide_empty_category
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_rplg_short_category_name_by
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_rplg_order_category_ids
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+268
    Undefined index: nm_rplg_hide_comment_count
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+268
    Undefined index: nm_rplg_hide_posted_date
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+268
    Undefined index: nm_rplg_hide_paging
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+268
    Undefined index: nm_rplg_hide_post_image
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+268
    Undefined index: nm_rplg_hide_post_short_content
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_rplg_select_paging_type
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_rplg_hide_post_short_content_length
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+268
    Undefined index: nm_rplg_read_more_link
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_rplg_image_content_width
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_rplg_image_height
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_rplg_shorting_posts_by
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_rplg_post_ordering_type
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_rplg_space_margin_between_posts
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_rplg_posts_grid_alignment
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_rplg_posts_loading_effect_on_pagination
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_rplg_mouse_hover_effect
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+268
    Undefined index: nm_rplg_show_author_image_and_name
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_rplg_default_category_open
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_st
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_richpostslistandgrid_license_url
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_rplg_security_key
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_all_selected_categories
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+266
    Undefined index: nm_rplg_media
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/include/shortcode.php+191
    Undefined index: default
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/templates/fields/fld_option.php+52
    Undefined index: onchange
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rplg_view
    • > Notice in wp-content/plugins/ajax-load-more-post/templates/fields/fld_option.php+52
    Undefined index: class

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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/ajax-load-more-post/templates/index.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: Too many tags (30 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

ajax-load-more-post/plugin.php 85% from 13 tests

The main PHP file in "Ajax Load More - WordPress infinite scroll" ver. 2.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ajax-load-more-post.php" instead of "plugin.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected4,273 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP196147872,541
JavaScript216120873
CSS26828499
PO File1151190360

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity53.40
▷ Minimum class complexity15.00
▷ Maximum class complexity159.00
Average method complexity5.60
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes120.00%
▷ Concrete classes480.00%
▷ Final classes00.00%
Methods57
▷ Static methods00.00%
▷ Public methods5698.25%
▷ Protected methods00.00%
▷ Private methods11.75%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
18 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/view.png1.80KB1.14KB▼ 36.27%
assets/images/view-more.png0.36KB0.33KB▼ 7.14%
assets/images/cart.png0.48KB0.47KB▼ 1.84%
assets/images/ac_open.png0.48KB0.52KB0.00%
assets/images/searchicon-3.png0.85KB0.83KB▼ 2.53%