78% database-operations

Code Review | Database Operations

WordPress plugin Database Operations scored78%from 54 tests.

About plugin

  • Plugin page: database-operations
  • Plugin version: 2.9.9
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.2
  • WordPress version: 6.3.1
  • First release: Jan 17, 2019
  • Latest release: Jul 25, 2019
  • Number of updates: 31
  • Update frequency: every 6.2 days
  • Top authors: devjoe2016 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,014 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼0.09MB] [CPU: ▼10.92ms] Passed 4 tests

This is a short check of server-side resources used by Database Operations
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1127.11 ▼16.49
Dashboard /wp-admin3.25 ▼0.0629.82 ▼19.76
Posts /wp-admin/edit.php3.32 ▼0.0345.56 ▼0.55
Add New Post /wp-admin/post-new.php5.56 ▼0.3293.44 ▲2.46
Media Library /wp-admin/upload.php3.27 ▲0.0427.22 ▼6.87
Add New /wp-admin/post-new.php?post_type=ct_ms3.3440.27
All Database Operations /wp-admin/edit.php?post_type=ct_ms3.3031.29

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 44 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Database Operations
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,988 ▲25314.54 ▲0.1412.34 ▲10.6641.79 ▼9.34
Dashboard /wp-admin2,245 ▲575.45 ▲0.57103.45 ▼11.6238.69 ▼8.44
Posts /wp-admin/edit.php2,131 ▲422.49 ▲0.5246.71 ▲0.8944.47 ▲7.30
Add New Post /wp-admin/post-new.php1,552 ▲3823.27 ▼0.30678.09 ▲0.9035.01 ▼18.30
Media Library /wp-admin/upload.php1,433 ▲484.71 ▲0.47102.77 ▲0.0943.75 ▲1.40
Add New /wp-admin/post-new.php?post_type=ct_ms1,7943.1668.7255.39
All Database Operations /wp-admin/edit.php?post_type=ct_ms1,1032.3638.6727.86

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=ct_ms
    • > Warning in wp-content/plugins/database-operations/admin/class-database-operations-admin.php+92
    Use of undefined constant PWPC_CHARTS_VERSION - assumed 'PWPC_CHARTS_VERSION' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=ct_ms
    • > Warning in wp-content/plugins/database-operations/admin/class-database-operations-admin.php+67
    Use of undefined constant db_wp_charts_init - assumed 'db_wp_charts_init' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=ct_ms
    • > Warning in wp-content/plugins/database-operations/admin/class-database-operations-admin.php+68
    Use of undefined constant db_wp_charts_admin - assumed 'db_wp_charts_admin' (this will throw an Error in a future version of PHP)
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=ct_ms
    • > Warning in wp-content/plugins/database-operations/admin/views/database-operations-form-admin-display.php+158
    Use of undefined constant PWPC_CHARTS_TEXT_DOMAIN - assumed 'PWPC_CHARTS_TEXT_DOMAIN' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/post-new.php?post_type=ct_ms
    • > Notice in wp-content/plugins/database-operations/admin/views/database-operations-admin-display.php+15
    Undefined variable: res

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function db_op_retrieve_dbs() in wp-content/plugins/database-operations/admin/views/database-operations-form-admin-display.php:4
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/database-operations/admin/views/database-operations-init-admin-display.php:7

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 Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: database operations, mysql, db, database management, database...

database-operations/db_op.php 77% from 13 tests

The main file in "Database Operations" v. 2.9.9 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("database-operations.php" instead of "db_op.php")
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Description: Please don't use more than 140 characters for the plugin description (currently 219 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected3,208 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript82772322,004
PHP14197393611
CSS44030593

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity1.80
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods35
▷ Static methods25.71%
▷ Public methods2880.00%
▷ Protected methods00.00%
▷ Private methods720.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin