79% same-but-different

Code Review | Same but Different - Related Posts by Taxonomy

WordPress plugin Same but Different - Related Posts by Taxonomy scored79%from 54 tests.

About plugin

  • Plugin page: same-but-different
  • Plugin version: 1.0.13
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Nov 8, 2019
  • Latest release: Nov 23, 2023
  • Number of updates: 17
  • Update frequency: every 86.9 days
  • Top authors: outtheboxthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /4,083 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.06MB] [CPU: ▲0.83ms] Passed 4 tests

Analyzing server-side resources used by Same but Different - Related Posts by Taxonomy
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0745.04 ▲5.00
Dashboard /wp-admin3.37 ▲0.0353.04 ▼5.89
Posts /wp-admin/edit.php3.42 ▲0.0654.89 ▲2.94
Add New Post /wp-admin/post-new.php5.96 ▲0.0799.26 ▲1.29
Media Library /wp-admin/upload.php3.30 ▲0.0740.80 ▲9.17
Same but Different1 /wp-admin/themes.php?page=same-but-different_settings3.3038.95

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
otb_new_theme
otb_new_plugin
same_but_different_version
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_otb_same_but_different_widget

Browser metrics Passed 4 tests

A check of browser resources used by Same but Different - Related Posts by Taxonomy
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲5814.34 ▲0.001.71 ▼0.0938.02 ▼7.90
Dashboard /wp-admin2,208 ▲315.64 ▲0.0691.37 ▼9.7739.59 ▼3.31
Posts /wp-admin/edit.php2,113 ▲102.01 ▲0.0440.34 ▼4.2138.82 ▲3.38
Add New Post /wp-admin/post-new.php1,540 ▲423.19 ▼0.00603.28 ▼73.3053.03 ▼11.32
Media Library /wp-admin/upload.php1,416 ▲164.20 ▲0.0198.09 ▼4.3746.46 ▲3.32
Same but Different1 /wp-admin/themes.php?page=same-but-different_settings1,0051.9823.9736.30

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 detected upon uninstall: 10 options
    • widget_otb_same_but_different_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • otb_new_theme
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • otb_new_plugin
    • same_but_different_version

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/themes.php?page=same-but-different_settings
    • > Warning in wp-content/plugins/same-but-different/library/classes/otb-same-but-different-admin-api.php+128
    in_array() expects parameter 2 to be array, string given

SRP 50% 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
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/same-but-different/library/template-parts/content-settings.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/same-but-different/library/classes/otb-same-but-different-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function update_option() in wp-content/plugins/same-but-different/library/template-parts/content-plugins.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/same-but-different/library/template-parts/tabs.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_archive() in wp-content/plugins/same-but-different/library/includes/get-related-posts.php:4
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/same-but-different/library/template-parts/related-posts.php on line 3
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/same-but-different/library/template-parts/related-posts.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function update_option() in wp-content/plugins/same-but-different/library/template-parts/content-themes.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: similar posts, related articles, related posts, contextual related posts, related posts widget

same-but-different/same-but-different.php Passed 13 tests

The main file in "Same but Different - Related Posts by Taxonomy" v. 1.0.13 serves as a complement to information provided in readme.txt and as the entry point to the plugin
58 characters long description:
Display related posts based on common categories and tags.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin1,496 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP133343791,119
CSS2693369
JavaScript2218

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity37.25
▷ Minimum class complexity15.00
▷ Maximum class complexity74.00
Average method complexity4.37
▷ Minimum method complexity1.00
▷ Maximum method complexity48.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods43
▷ Static methods24.65%
▷ Public methods4093.02%
▷ Protected methods12.33%
▷ Private methods24.65%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
3 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
library/images/image-size-3-2.png0.92KB0.09KB▼ 89.74%
library/images/image-size-4-3.png0.92KB0.09KB▼ 89.75%
library/images/image-size-1-1.png0.93KB0.09KB▼ 89.79%