83% duplicate-post-and-replace-text

Code Review | Duplicate Post

WordPress plugin Duplicate Post scored83%from 54 tests.

About plugin

  • Plugin page: duplicate-post-an...
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.2
  • WordPress version: 6.3.1
  • First release: Jul 17, 2019
  • Latest release: Jul 17, 2019
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: imvishalchodvadiya (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /680 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.35ms] Passed 4 tests

Analyzing server-side resources used by Duplicate Post
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0143.59 ▼3.89
Dashboard /wp-admin3.35 ▲0.0551.32 ▼1.97
Posts /wp-admin/edit.php3.40 ▲0.0455.36 ▲5.06
Add New Post /wp-admin/post-new.php5.93 ▲0.0491.33 ▼1.03
Media Library /wp-admin/upload.php3.27 ▲0.0437.05 ▼2.49
Duplicate Post and Replace Text /wp-admin/options-general.php?page=dprt3.2432.01

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Duplicate Post
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.73 ▲0.111.90 ▲0.2045.09 ▼0.88
Dashboard /wp-admin2,196 ▲255.54 ▼0.0996.32 ▼2.2344.64 ▼0.01
Posts /wp-admin/edit.php2,108 ▲81.94 ▼0.0335.66 ▼2.4330.86 ▼4.21
Add New Post /wp-admin/post-new.php1,531 ▲523.07 ▼0.18674.40 ▼83.9868.04 ▲15.13
Media Library /wp-admin/upload.php1,407 ▲74.21 ▼0.0694.99 ▼20.8447.15 ▼3.57
Duplicate Post and Replace Text /wp-admin/options-general.php?page=dprt8242.0223.9325.84

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/duplicate-post-and-replace-text/duplicate-post-replace-text-admin.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Contributors: Plugin contributors field is missing
The official readme.txt might help

duplicate-post-and-replace-text/duplicate-post-replace-text.php 85% from 13 tests

The main PHP script in "Duplicate Post" version 1.1.1 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("duplicate-post-and-replace-text.php" instead of "duplicate-post-replace-text.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin189 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP33921189

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.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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There were not PNG files found in your plugin