83% db-tables-importexport

Code Review | DB Tables Import/Export

WordPress plugin DB Tables Import/Export scored83%from 54 tests.

About plugin

  • Plugin page: db-tables-importe...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.3
  • WordPress version: 6.3.1
  • First release: Oct 21, 2015
  • Latest release: Oct 21, 2015
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: Bigbabert (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /5,501 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.02MB] [CPU: ▼2.33ms] Passed 4 tests

A check of server-side resources used by DB Tables Import/Export
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.21 ▲3.45
Dashboard /wp-admin3.34 ▼0.0148.68 ▼10.03
Posts /wp-admin/edit.php3.39 ▲0.0347.24 ▲2.10
Add New Post /wp-admin/post-new.php5.92 ▲0.0382.72 ▼4.85
Media Library /wp-admin/upload.php3.26 ▲0.0338.62 ▲6.27
AT DB > EXPORT /wp-admin/tools.php?page=alter-db-tables3.2932.24
AT DB > IMPORT /wp-admin/tools.php?page=alter_db_tables_csv_to_db_menu_page3.2433.71

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 45 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for DB Tables Import/Export
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲5914.33 ▼0.201.92 ▲0.4143.60 ▲2.91
Dashboard /wp-admin2,214 ▲435.61 ▲0.0796.79 ▲8.0042.96 ▲2.35
Posts /wp-admin/edit.php2,116 ▲161.96 ▼0.0636.29 ▲2.4634.82 ▼3.80
Add New Post /wp-admin/post-new.php1,542 ▲422.93 ▼0.13662.10 ▼21.3752.69 ▲4.52
Media Library /wp-admin/upload.php1,416 ▲164.23 ▲0.00102.36 ▼7.4746.04 ▼0.59
AT DB > EXPORT /wp-admin/tools.php?page=alter-db-tables9771.9331.1228.87
AT DB > IMPORT /wp-admin/tools.php?page=alter_db_tables_csv_to_db_menu_page1,2482.4844.8648.81

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/db-tables-importexport/admin/alter-db-tables-admin-class.php on line 21
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/db-tables-importexport/admin/alter-db-tables-admin-class.php on line 21
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/db-tables-importexport/admin/views/export.php:19
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/db-tables-importexport/admin/alter-db-tables-admin-class.php on line 21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (This screen shot is of the import section.), #2 (This screen shot is of the export section.)
You can take inspiration from this readme.txt

db-tables-importexport/alter-db-tables.php 77% from 13 tests

The main PHP script in "DB Tables Import/Export" version 1.0.1 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 166 characters long)
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("db-tables-importexport.php" instead of "alter-db-tables.php")

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
Everything looks great! No dangerous files found in this plugin3,413 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP8243721946
JavaScript56674936
CSS44921564
SVG103540
PO File1103130294
Markdown1740133

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity9.90
▷ Minimum class complexity1.00
▷ Maximum class complexity43.00
Average method complexity2.71
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods53
▷ Static methods713.21%
▷ Public methods4890.57%
▷ Protected methods00.00%
▷ Private methods59.43%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.56MB with 0.35MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png239.71KB62.01KB▼ 74.13%
admin/views/img/alter-tech-logo.png5.66KB3.10KB▼ 45.19%
screenshot-1.png324.59KB94.66KB▼ 70.84%