10% importyourpost

Code Review | Import Your Post

WordPress plugin Import Your Post scored10%from 54 tests.

About plugin

  • Plugin page: importyourpost
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.7
  • WordPress version: 6.3.1
  • First release: Nov 11, 2013
  • Latest release: Nov 12, 2013
  • Number of updates: 5
  • Update frequency: every 0.4 days
  • Top authors: Bratched (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,583 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > 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.)

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.51ms] Passed 4 tests

A check of server-side resources used by Import Your Post
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.46 ▼4.70
Dashboard /wp-admin3.33 ▲0.0343.74 ▼2.19
Posts /wp-admin/edit.php3.38 ▲0.0347.54 ▲3.89
Add New Post /wp-admin/post-new.php5.91 ▲0.0288.31 ▼7.44
Media Library /wp-admin/upload.php3.25 ▲0.0235.51 ▲0.28
IYP-Import /wp-admin/tools.php?page=wp_plugin_ImportYourPost_addPosts3.2931.15
IYP-Settings /wp-admin/options-general.php?page=wp_plugin_ImportYourPost_settings3.2128.66

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 13 new files
Database: 2 new tables, 7 new options
New tables
wp_importpost_lastchoice
wp_importpost_history
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
recovery_mode_email_last_sent
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Import Your Post
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6213.27 ▼1.111.60 ▼0.1442.15 ▼3.77
Dashboard /wp-admin2,217 ▲265.85 ▲0.9899.79 ▼17.5740.46 ▼6.75
Posts /wp-admin/edit.php2,097 ▲82.03 ▼0.1339.40 ▲2.3235.46 ▼0.20
Add New Post /wp-admin/post-new.php1,548 ▲2918.13 ▼4.94597.04 ▼114.2156.22 ▼4.35
Media Library /wp-admin/upload.php1,390 ▲54.22 ▲0.0896.95 ▼6.4643.55 ▼0.43
IYP-Import /wp-admin/tools.php?page=wp_plugin_ImportYourPost_addPosts8681.6112.6928.48
IYP-Settings /wp-admin/options-general.php?page=wp_plugin_ImportYourPost_settings6941.146.8222.51

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_importpost_history
    • wp_importpost_lastchoice
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • recovery_mode_email_last_sent
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/tools.php?page=wp_plugin_ImportYourPost_addPosts
    • > Notice in wp-content/plugins/importyourpost/addPosts.php+82
    Undefined index: update
    • > GET request to /wp-admin/tools.php?page=wp_plugin_ImportYourPost_addPosts
    • > Notice in wp-content/plugins/importyourpost/addPosts.php+134
    Undefined index: import_url
    • > GET request to /wp-admin/tools.php?page=wp_plugin_ImportYourPost_addPosts
    • > Notice in wp-content/plugins/importyourpost/addPosts.php+145
    Undefined index: source_text
    • > GET request to /wp-admin/tools.php?page=wp_plugin_ImportYourPost_addPosts
    • > 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.)
    • > GET request to /wp-admin/tools.php?page=wp_plugin_ImportYourPost_addPosts
    • > Deprecated in wp-content/plugins/importyourpost/pagination.class.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; pagination has a deprecated constructor
    • > GET request to /wp-admin/tools.php?page=wp_plugin_ImportYourPost_addPosts
    • > Error in wp-content/plugins/importyourpost/historypost.php+111
    Uncaught Error: Call to undefined function mysql_num_rows() in wp-content/plugins/importyourpost/historypost.php:111
    Stack trace:
    #0 wp-content/plugins/importyourpost/addPosts.php(223): PageHistory()
    #1 wp-content/plugins/importyourpost/importyourpost.php(74): include('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(310): WP_Plugin_ImportYourPost->plugin_addPosts_page()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 wp-admin/tools.php(40): require_once('/var/www/wordpr...')
    #7 {main}
    thrown
    • > GET request to /wp-admin/options-general.php?page=wp_plugin_ImportYourPost_settings
    • > Error in wp-admin/includes/template.php+1801
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/importyourpost/settings.php on line 13 and exactly 2 expected in wp-admin/includes/template.php:1801
    Stack trace:
    #0 wp-content/plugins/importyourpost/settings.php(13): do_settings_fields()
    #1 wp-content/plugins/importyourpost/importyourpost.php(65): include('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(310): WP_Plugin_ImportYourPost->plugin_settings_page()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #7 {main}
    thrown

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
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/importyourpost/pagination.class.php
    • > /wp-content/plugins/importyourpost/simple_html_dom.php
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/importyourpost/addPosts.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/importyourpost/importyourpost.php:118
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/importyourpost/transformpost.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/importyourpost/settings.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 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Donate link: Invalid URI ("")
  • Screenshots: These screenshots require images: #2 (Inport from a source HTML description), #3 (History imported posts)
You can look at the official readme.txt

importyourpost/importyourpost.php 92% from 13 tests

The main PHP file in "Import Your Post" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 385 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin2,493 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP103864142,371
PO File14955122

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity62.17
▷ Minimum class complexity2.00
▷ Maximum class complexity197.00
Average method complexity4.22
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods114
▷ Static methods32.63%
▷ Public methods9885.96%
▷ Protected methods1614.04%
▷ Private methods00.00%
Functions34
▷ Named functions34100.00%
▷ Anonymous functions00.00%
Constants21
▷ Global constants21100.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
No PNG images were found in this plugin