10% dw-directory

Code Review | DW Directory Service

WordPress plugin DW Directory Service scored 10% from 54 tests.

About plugin

  • Plugin page: dw-directory
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.1.0
  • WordPress version: 6.3.1
  • First release: Nov 13, 2016
  • Latest release: Apr 24, 2019
  • Number of updates: 10
  • Update frequency: every 88.7 days
  • Top authors: dhlee7 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 614 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/dw-directory/daworks.php+34
    Non-static method Daworks_Activator::install_plugins() should not be called statically

Server metrics [RAM: ▲0.29MB] [CPU: ▼2.95ms] Passed 4 tests

Server-side resources used by DW Directory Service
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2938.15 ▼10.13
Dashboard /wp-admin3.60 ▲0.2947.70 ▼6.60
Posts /wp-admin/edit.php3.71 ▲0.3552.66 ▲7.90
Add New Post /wp-admin/post-new.php6.18 ▲0.2990.12 ▲1.44
Media Library /wp-admin/upload.php3.52 ▲0.2937.87 ▲3.48
아이템 관리 /wp-admin/admin.php?page=dw-directory-manage-item-slug3.5035.64
등록 대기 관리 /wp-admin/admin.php?page=dw-directory-standby-slug3.5031.90
카테고리 관리 /wp-admin/admin.php?page=dw-directory-manage-cat-slug3.5033.87

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 140 new files
Database: 2 new tables, 7 new options
New tables
wp_dw_directory
wp_dw_directory_category
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
daworks_directory_db_version
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for DW Directory Service
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,921 ▲17513.57 ▼0.728.90 ▲7.0639.96 ▼6.32
Dashboard /wp-admin2,234 ▲435.85 ▲1.0097.11 ▼22.0245.90 ▼0.26
Posts /wp-admin/edit.php2,120 ▲342.05 ▲0.0441.22 ▲4.6044.10 ▲6.61
Add New Post /wp-admin/post-new.php1,540 ▲2123.23 ▲0.11670.57 ▲7.2061.25 ▲2.66
Media Library /wp-admin/upload.php1,419 ▲314.34 ▲0.10106.50 ▼7.0451.33 ▲2.51
아이템 관리 /wp-admin/admin.php?page=dw-directory-manage-item-slug1,1962.3531.9077.72
등록 대기 관리 /wp-admin/admin.php?page=dw-directory-standby-slug9062.1028.0658.36
카테고리 관리 /wp-admin/admin.php?page=dw-directory-manage-cat-slug1,0401.6925.7569.57

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie tables were found after uninstall: 2 tables
    • wp_dw_directory_category
    • wp_dw_directory
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • daworks_directory_db_version

Smoke tests 25% 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 0% 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
Please take a closer look at the following
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/dw-directory/admin/partials/daworks-admin-display.php
    • > /wp-content/plugins/dw-directory/admin/partials/daworks-admin-footer.php
    • > /wp-content/plugins/dw-directory/public/partials/daworks-public-display.php
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/dw-directory/admin/partials/daworks-admin-main.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function menu_page_url() in wp-content/plugins/dw-directory/admin/partials/daworks-admin-nav.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/dw-directory/admin/partials/daworks-admin-item.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/dw-directory/admin/partials/daworks-admin-category.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dw-directory/includes/functions-daworks.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dw-directory-manage-cat-slug
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/dw-directory/public/js/daworks-public.js?ver=1.0.0:73:32)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dw-directory-manage-cat-slug
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function
    • > GET request to /wp-admin/admin.php?page=dw-directory-manage-item-slug
    • > Console-api (warning) in wp-content/plugins/dw-directory/admin/js/daworks-admin-item.js?ver=6.3.1+42:12
    DB 쿼리 오류!
    • > GET request to /wp-admin/admin.php?page=dw-directory-manage-cat-slug
    • > Javascript (severe) in unknown
    /wp-content/plugins/dw-directory/admin/js/daworks-admin-cat.js?ver=6.3.1 60:13 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: sitemap, directory, address book, yellow page

dw-directory/daworks.php 77% from 13 tests

The main file in "DW Directory Service" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 226 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("dw-directory.php" instead of "daworks.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Good job! No executable or dangerous file extensions detected12,511 lines of code in 62 files:
LanguageFilesBlank linesComment linesLines of code
Sass16108342,726
SVG1002,671
CSS40142,330
PHP193515981,901
LESS1434441,758
JavaScript5168601,038
JSON20059
Markdown123028

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity5.88
▷ Minimum class complexity1.00
▷ Maximum class complexity38.00
Average method complexity1.98
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods40
▷ Static methods25.00%
▷ Public methods3485.00%
▷ Protected methods00.00%
▷ Private methods615.00%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
16 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/icon-ok.png0.99KB0.94KB▼ 4.75%
admin/img/corner-success.png0.23KB0.20KB▼ 13.56%
admin/img/icon-ok@2x.png1.63KB1.69KB0.00%
admin/img/corner-success@2x.png0.34KB0.28KB▼ 18.00%
admin/img/icon-warn@2x.png1.67KB1.96KB0.00%