63% dx-contribute

Code Review | DX-Contribute

WordPress plugin DX-Contribute scored63%from 54 tests.

About plugin

  • Plugin page: dx-contribute
  • Plugin version: 1.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.5
  • WordPress version: 6.3.1
  • First release: Oct 24, 2012
  • Latest release: Jan 3, 2013
  • Number of updates: 14
  • Update frequency: every 5.1 days
  • Top authors: daxiawp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /6,856 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▼1.22MB] [CPU: ▼40.53ms] Passed 4 tests

This is a short check of server-side resources used by DX-Contribute
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.76 ▼0.7014.78 ▼28.25
Dashboard /wp-admin2.79 ▼0.5115.88 ▼38.74
Posts /wp-admin/edit.php2.79 ▼0.5617.04 ▼29.77
Add New Post /wp-admin/post-new.php2.79 ▼3.0919.83 ▼65.34
Media Library /wp-admin/upload.php2.79 ▼0.4315.24 ▼15.72
投稿 /wp-admin/admin.php?page=DX-Contribute2.7916.46
daxiawp主题商城 /wp-admin/admin.php?page=daxiawp_theme2.7916.54

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for DX-Contribute
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲11613.23 ▼1.454.78 ▲2.9342.49 ▼7.24
Dashboard /wp-admin2,232 ▲445.82 ▼0.0996.12 ▼16.1385.95 ▲43.90
Posts /wp-admin/edit.php2,118 ▲291.97 ▼0.0338.35 ▲2.7143.08 ▲10.53
Add New Post /wp-admin/post-new.php1,546 ▲2718.37 ▼4.83651.17 ▼12.0863.34 ▲11.65
Media Library /wp-admin/upload.php1,414 ▲264.21 ▲0.0596.12 ▼2.8391.81 ▲46.06
投稿 /wp-admin/admin.php?page=DX-Contribute1,0102.0428.2891.96
daxiawp主题商城 /wp-admin/admin.php?page=daxiawp_theme1,0504.65131.0750.40

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
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/dx-contribute/dx-contribute.php+47
    Undefined index: DX-Contribute
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=daxiawp_theme
    • > Notice in wp-content/plugins/dx-contribute/dx-contribute.php+47
    Undefined index: DX-Contribute
    • > GET request to /wp-admin/admin.php?page=DX-Contribute
    • > Notice in wp-content/plugins/dx-contribute/options-form.php+4
    Undefined index: submit
  • 15 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=DX-Contribute
    • > Notice in wp-content/plugins/dx-contribute/options-form.php+141
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/dx-contribute/dx-contribute.php:20
    • > PHP Notice
      Undefined index: submit in wp-content/plugins/dx-contribute/options-form.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/dx-contribute/options-form.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/dx-contribute/contribute-page.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dx-contribute/theme.php:4

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=DX-Contribute
    • > Network (severe)
    https://wpa.qq.com/pa?p=2:1683134075:44 - Failed to load resource: the server responded with a status of 404 ()
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=daxiawp_theme
    • > Javascript (warning) in unknown
    http://cbjs.baidu.com/js/m.js 0 A parser-blocking, cross site (i.e. different eTLD+1) script, https://pos.baidu.com/jcym?di=454435&uuid=f71eb6e01467dcb2&dri=0&dis=0&dai=0&ps=136x64&enu=encoding&exps=110011&ant=0&psi=98425431a4ee37f6&dcb=___adblockplus_&dtm=SSP_JSONP&dvi=0.0&dci=-1&dpt=none&tpr=1696531676293&ti=%E4%B8%BB%E9%A2%98%E5%95%86%E5%9F%8E%20%E2%80%B9%20Potrivit%20%E2%80%94%20WordPress&ari=2&ver=0830&vc=daxiawp%E4%B8%BB%E9%A2%98&dbv=2&drs=1&pcs=800x585&pss=1038x585&cfv=0&cpl=0&chi=16&cce=true&cec=UTF-8&tlm=1696531676&prot=2&rw=600&ltu=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin.php%3Fpage%3Ddaxiawp_theme&ecd=1&dft=0&uc=800x600&pis=-1x-1&sr=800x600&tcn=1696531676, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=daxiawp_theme
    • > Javascript (warning) in unknown
    http://cbjs.baidu.com/js/m.js 0 A parser-blocking, cross site (i.e. different eTLD+1) script, https://pos.baidu.com/jcym?di=454451&uuid=6a45566897f64067&dri=0&dis=0&dai=0&ps=136x386&enu=encoding&exps=110011&ant=0&psi=98425431a4ee37f6&dcb=___adblockplus_&dtm=SSP_JSONP&dvi=0.0&dci=-1&dpt=none&tpr=1696531676293&ti=%E4%B8%BB%E9%A2%98%E5%95%86%E5%9F%8E%20%E2%80%B9%20Potrivit%20%E2%80%94%20WordPress&ari=2&ver=0830&vc=BAIDU_CLB_fillSlot(%22454435%22)%3B&dbv=2&drs=1&pcs=800x585&pss=1038x585&cfv=0&cpl=0&chi=16&cce=true&cec=UTF-8&tlm=1696531677&prot=2&rw=600&ltu=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin.php%3Fpage%3Ddaxiawp_theme&ecd=1&dft=0&uc=800x600&pis=-1x-1&sr=800x600&tcn=1696531678, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=daxiawp_theme
    • > Javascript (warning) in unknown
    http://cbjs.baidu.com/js/m.js 0 A parser-blocking, cross site (i.e. different eTLD+1) script, https://pos.baidu.com/jcym?di=454453&uuid=667d2e03da0fb80f&dri=0&dis=0&dai=0&ps=136x708&enu=encoding&exps=110011&ant=0&psi=98425431a4ee37f6&dcb=___adblockplus_&dtm=SSP_JSONP&dvi=0.0&dci=-1&dpt=none&tpr=1696531676293&ti=%E4%B8%BB%E9%A2%98%E5%95%86%E5%9F%8E%20%E2%80%B9%20Potrivit%20%E2%80%94%20WordPress&ari=2&ver=0830&vc=BAIDU_CLB_fillSlot(%22454451%22)%3B&dbv=2&drs=1&pcs=800x585&pss=1038x585&cfv=0&cpl=0&chi=16&cce=true&cec=UTF-8&tlm=1696531678&prot=2&rw=600&ltu=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin.php%3Fpage%3Ddaxiawp_theme&ecd=1&dft=0&uc=800x600&pis=-1x-1&sr=800x600&tcn=1696531678, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=daxiawp_theme
    • > Javascript (warning) in unknown
    http://cbjs.baidu.com/js/m.js 0 A parser-blocking, cross site (i.e. different eTLD+1) script, https://pos.baidu.com/jcym?di=454454&uuid=2781c32d67c8dfd8&dri=0&dis=0&dai=0&ps=388x64&enu=encoding&exps=110011&ant=0&psi=98425431a4ee37f6&dcb=___adblockplus_&dtm=SSP_JSONP&dvi=0.0&dci=-1&dpt=none&tpr=1696531676293&ti=%E4%B8%BB%E9%A2%98%E5%95%86%E5%9F%8E%20%E2%80%B9%20Potrivit%20%E2%80%94%20WordPress&ari=2&ver=0830&vc=BAIDU_CLB_fillSlot(%22454453%22)%3B&dbv=2&drs=1&pcs=800x585&pss=1038x585&cfv=0&cpl=0&chi=16&cce=true&cec=UTF-8&tlm=1696531678&prot=2&rw=600&ltu=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin.php%3Fpage%3Ddaxiawp_theme&ecd=1&dft=0&uc=800x600&pis=-1x-1&sr=800x600&tcn=1696531678, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=daxiawp_theme
    • > Javascript (warning) in unknown
    http://cbjs.baidu.com/js/m.js 0 A parser-blocking, cross site (i.e. different eTLD+1) script, https://pos.baidu.com/jcym?di=454455&uuid=31c476fe7803789b&dri=0&dis=0&dai=0&ps=388x386&enu=encoding&exps=110011&ant=0&psi=98425431a4ee37f6&dcb=___adblockplus_&dtm=SSP_JSONP&dvi=0.0&dci=-1&dpt=none&tpr=1696531676293&ti=%E4%B8%BB%E9%A2%98%E5%95%86%E5%9F%8E%20%E2%80%B9%20Potrivit%20%E2%80%94%20WordPress&ari=2&ver=0830&vc=BAIDU_CLB_fillSlot(%22454454%22)%3B&dbv=2&drs=1&pcs=785x585&pss=1038x699&cfv=0&cpl=0&chi=16&cce=true&cec=UTF-8&tlm=1696531678&prot=2&rw=600&ltu=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin.php%3Fpage%3Ddaxiawp_theme&ecd=1&dft=0&uc=800x600&pis=-1x-1&sr=800x600&tcn=1696531679, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=daxiawp_theme
    • > Javascript (warning) in unknown
    http://cbjs.baidu.com/js/m.js 0 A parser-blocking, cross site (i.e. different eTLD+1) script, https://pos.baidu.com/jcym?di=454457&uuid=19fbcc4ed333b8d7&dri=0&dis=0&dai=0&ps=388x708&enu=encoding&exps=110011&ant=0&psi=98425431a4ee37f6&dcb=___adblockplus_&dtm=SSP_JSONP&dvi=0.0&dci=-1&dpt=none&tpr=1696531676293&ti=%E4%B8%BB%E9%A2%98%E5%95%86%E5%9F%8E%20%E2%80%B9%20Potrivit%20%E2%80%94%20WordPress&ari=2&ver=0830&vc=BAIDU_CLB_fillSlot(%22454455%22)%3B&dbv=2&drs=1&pcs=785x585&pss=1038x699&cfv=0&cpl=0&chi=16&cce=true&cec=UTF-8&tlm=1696531679&prot=2&rw=600&ltu=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin.php%3Fpage%3Ddaxiawp_theme&ecd=1&dft=0&uc=800x600&pis=-1x-1&sr=800x600&tcn=1696531679, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=daxiawp_theme
    • > Javascript (warning) in unknown
    http://cbjs.baidu.com/js/m.js 0 A parser-blocking, cross site (i.e. different eTLD+1) script, https://pos.baidu.com/jcym?di=454459&uuid=d6001c12640c674b&dri=0&dis=0&dai=0&ps=640x64&enu=encoding&exps=110011&ant=0&psi=98425431a4ee37f6&dcb=___adblockplus_&dtm=SSP_JSONP&dvi=0.0&dci=-1&dpt=none&tpr=1696531676293&ti=%E4%B8%BB%E9%A2%98%E5%95%86%E5%9F%8E%20%E2%80%B9%20Potrivit%20%E2%80%94%20WordPress&ari=2&ver=0830&vc=BAIDU_CLB_fillSlot(%22454457%22)%3B&dbv=2&drs=1&pcs=785x585&pss=1038x726&cfv=0&cpl=0&chi=16&cce=true&cec=UTF-8&tlm=1696531679&prot=2&rw=600&ltu=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin.php%3Fpage%3Ddaxiawp_theme&ecd=1&dft=0&uc=800x600&pis=-1x-1&sr=800x600&tcn=1696531679, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=daxiawp_theme
    • > Javascript (warning) in unknown
    http://cbjs.baidu.com/js/m.js 0 A parser-blocking, cross site (i.e. different eTLD+1) script, https://pos.baidu.com/jcym?di=454461&uuid=d9fa734a6a9a4070&dri=0&dis=0&dai=0&ps=640x386&enu=encoding&exps=110011&ant=0&psi=98425431a4ee37f6&dcb=___adblockplus_&dtm=SSP_JSONP&dvi=0.0&dci=-1&dpt=none&tpr=1696531676293&ti=%E4%B8%BB%E9%A2%98%E5%95%86%E5%9F%8E%20%E2%80%B9%20Potrivit%20%E2%80%94%20WordPress&ari=2&ver=0830&vc=BAIDU_CLB_fillSlot(%22454459%22)%3B&dbv=2&drs=1&pcs=785x585&pss=1038x951&cfv=0&cpl=0&chi=16&cce=true&cec=UTF-8&tlm=1696531679&prot=2&rw=600&ltu=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin.php%3Fpage%3Ddaxiawp_theme&ecd=1&dft=0&uc=800x600&pis=-1x-1&sr=800x600&tcn=1696531680, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=daxiawp_theme
    • > Javascript (warning) in unknown
    http://cbjs.baidu.com/js/m.js 0 A parser-blocking, cross site (i.e. different eTLD+1) script, https://pos.baidu.com/jcym?di=454462&uuid=5d0eff46a614321b&dri=0&dis=0&dai=0&ps=640x708&enu=encoding&exps=110011&ant=0&psi=98425431a4ee37f6&dcb=___adblockplus_&dtm=SSP_JSONP&dvi=0.0&dci=-1&dpt=none&tpr=1696531676293&ti=%E4%B8%BB%E9%A2%98%E5%95%86%E5%9F%8E%20%E2%80%B9%20Potrivit%20%E2%80%94%20WordPress&ari=2&ver=0830&vc=BAIDU_CLB_fillSlot(%22454461%22)%3B&dbv=2&drs=1&pcs=785x585&pss=1038x951&cfv=0&cpl=0&chi=16&cce=true&cec=UTF-8&tlm=1696531680&prot=2&rw=600&ltu=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin.php%3Fpage%3Ddaxiawp_theme&ecd=1&dft=0&uc=800x600&pis=-1x-1&sr=800x600&tcn=1696531680, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
1 plugin tags: contribute

dx-contribute/dx-contribute.php Passed 13 tests

The main PHP script in "DX-Contribute" version 1.4.0 is automatically included on every request by WordPress
63 characters long description:
The shortcut Submission wordpress plugin. 快捷投稿插件。

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin515 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP46625345
JavaScript11611123
CSS10047

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity15.00
▷ Minimum class complexity15.00
▷ Maximum class complexity15.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
icon.png0.80KB1.09KB0.00%