84% avoid-duplicate-posts

Code Review | Avoid Duplicate Posts

WordPress plugin Avoid Duplicate Posts scored84%from 54 tests.

About plugin

  • Plugin page: avoid-duplicate-p...
  • Plugin version: 1.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.9.2
  • WordPress version: 6.3.1
  • First release: Aug 8, 2015
  • Latest release: Mar 25, 2022
  • Number of updates: 20
  • Update frequency: every 121.1 days
  • Top authors: MyThemeShop (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /6,006 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.01MB] [CPU: ▼6.18ms] Passed 4 tests

Server-side resources used by Avoid Duplicate Posts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.84 ▲1.72
Dashboard /wp-admin3.31 ▼0.0449.88 ▼9.88
Posts /wp-admin/edit.php3.36 ▲0.0045.25 ▲1.22
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.65 ▼16.47
Media Library /wp-admin/upload.php3.23 ▲0.0031.60 ▲0.41

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Avoid Duplicate Posts: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲4913.24 ▼1.121.97 ▲0.0343.41 ▲0.05
Dashboard /wp-admin2,206 ▲185.85 ▲0.94107.00 ▼7.8042.89 ▼0.58
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0135.50 ▼1.5330.78 ▼2.64
Add New Post /wp-admin/post-new.php1,533 ▼1423.06 ▼0.21672.67 ▲55.2255.97 ▲9.59
Media Library /wp-admin/upload.php1,388 ▲34.30 ▲0.1398.74 ▼0.0842.42 ▼2.05

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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 have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/avoid-duplicate-posts/index.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: double posts, repeat posts, duplicate posts, remove duplicate posts

avoid-duplicate-posts/index.php 92% from 13 tests

"Avoid Duplicate Posts" version 1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("avoid-duplicate-posts.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin24 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP15824

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected