78% bestseller-lists-from-new-york-times

Code Review | Bestseller Lists from the New York Times

WordPress plugin Bestseller Lists from the New York Times scored78%from 54 tests.

About plugin

  • Plugin page: bestseller-lists-...
  • Plugin version: 2.3.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.3.0
  • WordPress version: 6.3.1
  • First release: Aug 1, 2018
  • Latest release: Sep 26, 2023
  • Number of updates: 33
  • Update frequency: every 57.2 days
  • Top authors: jakeparis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,837 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼9.62ms] Passed 4 tests

Server-side resources used by Bestseller Lists from the New York Times
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0739.03 ▼4.53
Dashboard /wp-admin3.37 ▲0.0248.29 ▼18.84
Posts /wp-admin/edit.php3.48 ▲0.1251.06 ▼1.19
Add New Post /wp-admin/post-new.php5.95 ▲0.0693.04 ▼13.93
Media Library /wp-admin/upload.php3.29 ▲0.0638.83 ▲8.14
NYT Bestseller Lists /wp-admin/options-general.php?page=nyt-bestseller-lists3.2632.66

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 15 new files
Database: no new tables, 8 new options
New WordPress options
nyt_bestseller_listings_apiKey
widget_recent-posts
bestseller-lists-nyt-plugin-version
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Bestseller Lists from the New York Times
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.25 ▼0.101.68 ▼0.3539.25 ▼3.05
Dashboard /wp-admin2,199 ▲225.57 ▼0.0983.49 ▼6.6840.50 ▼2.29
Posts /wp-admin/edit.php2,104 ▲41.98 ▼0.0436.30 ▲0.7431.89 ▼6.54
Add New Post /wp-admin/post-new.php6,365 ▲4,83927.71 ▲4.25934.21 ▲260.9253.39 ▼2.38
Media Library /wp-admin/upload.php1,398 ▲44.19 ▼0.0499.93 ▼3.5146.02 ▲2.20
NYT Bestseller Lists /wp-admin/options-general.php?page=nyt-bestseller-lists8122.1524.4830.33

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • db_upgraded
    • bestseller-lists-nyt-plugin-version
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 5× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/bestseller-lists-from-new-york-times/functions.php
    • > /wp-content/plugins/bestseller-lists-from-new-york-times/index.php
    • > /wp-content/plugins/bestseller-lists-from-new-york-times/plugin-updates.php
    • > /wp-content/plugins/bestseller-lists-from-new-york-times/class-nytbestsellerlistings.php
    • > /wp-content/plugins/bestseller-lists-from-new-york-times/admin-page.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/bestseller-lists-from-new-york-times/build/lists/render.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 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
5 plugin tags: books, library, reading lists, bestsellers, libraries

bestseller-lists-from-new-york-times/index.php 85% from 13 tests

The main file in "Bestseller Lists from the New York Times" v. 2.3.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Requires PHP: The required version number must match the one declared in readme.txt ("5.4" instead of "7.4")
  • Main file name: The principal plugin file should be the same as the plugin slug ("bestseller-lists-from-new-york-times.php" instead of "index.php")

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
No dangerous file extensions were detected374 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP89059336
JSON20035
JavaScript2002
CSS1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity24.00
▷ Minimum class complexity24.00
▷ Maximum class complexity24.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods12100.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions550.00%
▷ Anonymous functions550.00%
Constants3
▷ Global constants3100.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
1 PNG file occupies 0.15MB with 0.10MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png152.11KB47.55KB▼ 68.74%