10% kindred-posts

Code Review | Kindred Posts

WordPress plugin Kindred Posts scored10%from 54 tests.

About plugin

  • Plugin page: kindred-posts
  • Plugin version: 1.3.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.8
  • WordPress version: 6.3.1
  • First release: Apr 3, 2013
  • Latest release: Sep 7, 2017
  • Number of updates: 47
  • Update frequency: every 34.5 days
  • Top authors: AiSpork (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

50+ active /5,349 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/kindred-posts/kindred-posts-lib.php+461
    Function create_function() is deprecated

Server metrics [RAM: ▼1.96MB] [CPU: ▼53.65ms] Passed 4 tests

A check of server-side resources used by Kindred Posts
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.445.26 ▼33.59
Dashboard /wp-admin2.05 ▼1.265.52 ▼41.57
Posts /wp-admin/edit.php2.05 ▼1.315.43 ▼44.80
Add New Post /wp-admin/post-new.php2.05 ▼3.845.41 ▼94.65
Media Library /wp-admin/upload.php2.05 ▼1.185.62 ▼29.76
Kindred Posts /wp-admin/options-general.php?page=kindred-posts2.055.93

Server storage [IO: ▲0.26MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 34 new files
Database: 1 new table, 9 new options
New tables
wp_kindred_posts_visits
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
kp_DbVersion
widget_recent-comments
kp_OptionsNamespaced
db_upgraded
widget_kp_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Kindred Posts
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.18 ▼0.191.86 ▼0.0649.00 ▲5.07
Dashboard /wp-admin2,199 ▲225.58 ▼0.0886.72 ▼2.9842.94 ▲6.55
Posts /wp-admin/edit.php2,104 ▲42.02 ▼0.0236.56 ▼0.7330.18 ▼7.78
Add New Post /wp-admin/post-new.php1,529 ▲423.63 ▲0.63618.97 ▲1.5871.21 ▲0.79
Media Library /wp-admin/upload.php1,395 ▲44.20 ▼0.01101.89 ▲0.8043.73 ▼3.38
Kindred Posts /wp-admin/options-general.php?page=kindred-posts1,1822.0122.8931.44

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/kindred-posts/kindred-posts-lib.php+461
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_kindred_posts_visits
  • The uninstall procedure has failed, leaving 9 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_kp_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • kp_OptionsNamespaced
    • can_compress_scripts
    • kp_DbVersion

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=kindred-posts
    • > Deprecated in wp-content/plugins/kindred-posts/kindred-posts-lib.php+461
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=kindred-posts
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)

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
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/kindred-posts/tests/tests-loader.php
  • 10× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/kindred-posts/kindred-posts-config.php on line 17
    • > PHP Warning
      include_once(..\\..\\..\\..\\..\\wp-load.php): failed to open stream: No such file or directory in wp-content/plugins/kindred-posts/tests/scripts/visit-data.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/kindred-posts/theme/templates.php:93
    • > PHP Warning
      include_once(): Failed opening '..\\..\\kindred-posts-index.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/kindred-posts/tests/scripts/visit-data.php on line 4
    • > PHP Notice
      Undefined variable: wpdb in wp-content/plugins/kindred-posts/tests/scripts/visit-data.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/kindred-posts/kindred-posts-index.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/kindred-posts/classes/widget.php:5
    • > PHP Warning
      include_once(..\\..\\kindred-posts-index.php): failed to open stream: No such file or directory in wp-content/plugins/kindred-posts/tests/scripts/visit-data.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/kindred-posts/tests/scripts/visit-data.php:9
    • > PHP Warning
      include_once(): Failed opening '..\\..\\..\\..\\..\\wp-load.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/kindred-posts/tests/scripts/visit-data.php on line 3

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)
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
10 plugin tags: artificial intelligence, analytics, similar posts, data mining, related posts...

kindred-posts/kindred-posts-index.php 92% from 13 tests

The main file in "Kindred Posts" v. 1.3.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("kindred-posts.php" instead of "kindred-posts-index.php")

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
Everything looks great! No dangerous files found in this plugin2,679 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP246231,0202,679

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity16.50
▷ Minimum class complexity2.00
▷ Maximum class complexity64.00
Average method complexity3.52
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods86
▷ Static methods910.47%
▷ Public methods86100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions43
▷ Named functions43100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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 PNG files occupy 0.10MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/qmark.png0.34KB0.19KB▼ 45.89%
screenshot-1.png95.94KB54.31KB▼ 43.40%
images/icon.png1.88KB1.51KB▼ 19.84%
images/horz.png0.33KB0.17KB▼ 48.54%
images/vert.png0.40KB0.17KB▼ 58.88%