This plugin allows you to integrate Million Dollar Script 2.1 with WordPress.
How To Use
Make sure you have the latest version of Million Dollar Script 2.1. You can find the version on the bottom left of the admin screen. It should be dated on or after 2020.11.13. If it shows only 2.1 you may have to save your Main Config.
In Million Dollar Script admin go to the Main Config and at the bottom enable the WP integration option. Enter the URL to your WP install, without the trailing slash. For example https://milliondollarscript.com
Enter the absolute path to your WP install. Example: /home/user/public_html
Next download, install and activate the WP integration plugin.
Once you install and activate this plugin it’ll add a new menu in WP admin on the side for Million Dollar Script. You can go to your WP admin to Million Dollar Script > Options and enable your desired options. These are explained below.
MDS Install Path
This should be the path to your MDS installation. In the future I plan to make it possible to install Million Dollar Script from within this plugin instead but for now you can just upload it to a subfolder or a subdomain if you like. As long as WP can read the MDS config.php file it should be ok.
Admin Integration
Now this integration plugin allows you to browse the Million Dollar Script admin from within the WP admin under Million Dollar Script > Admin. Currently this displays The Million Dollar Script admin inside an iframe on the page in WordPress.
When you enable admin integration you will be logged out of WordPress. This is because it installs a MU plugin into WordPress which adjusts the WordPress constants for COOKIE_DOMAIN, COOKIEPATH, and COOKIEHASH to match between Million Dollar Script and WordPress.
If you have these defined elsewhere for some reason then it may cause a conflict. They are defined in MDS/include/wp_functions.php if you have to adjust it from the Million Dollar Script side to match whatever you have them set to. This will allow them to share proper login cookies.
Users Integration
It now has the ability to integration user accounts between MDS and WP. If you enable this you may be logged out of WP if you haven’t already enabled Admin integration. They both will create a MU plugin for setting some cookie related values as explained above.
Once enabled, if a user tries to login to MDS they will be shown the WP login page. They can create an account through WP. Any users that create an account or login through WP will have an account created for them in MDS. Once they login successfully the account will automatically be validated in MDS.
When they log out of WP they will be logged out of MDS. If they update their user information in WP it will also be updated in MDS. If an account is deleted in WP it will be deleted in MDS, however associated orders are not presently deleted but may be in the future. I may add an option for that.
WooCommerce Integration
This allows you to use WooCommerce to handle orders. Therefore you can use any payment gateways that work with WooCommerce. By default it has PayPal support and some offline methods but you can add more plugins for additional gateways. There are a lot of them.
When WooCommerce integration is enabled products will have a Million Dollar Script Pixels type option on them. This is similar to Virtual or Downloadable but says Million Dollar Script Pixels instead.
You can select Million Dollar Script Pixels to ensure that it won’t appear in the shop or in the search and that the MDS functionality only runs on orders for MDS products to help prevent conflicts. If you have to make a product visible again edit it and on the top right side box you can edit the Catalog visibility.
Another thing this will do is cause it to also verify the quantity matches what it should when checking out. This way users can’t adjust the quantity in their cart after to get cheaper orders because it won’t allow them to checkout.
It’ll also mark orders as completed in MDS automatically when they are marked as completed in WooCommerce. If your orders are not completed, but stuck in processing then you will have to either automate that or manually adjust them. I may add an option for this in the future.
In order to make orders from MDS to WooCommerce you must install and enable the “Payment” payment module in MDS admin. You have to first create the product in WooCommerce and get it’s product ID value and add that to the URL in the payment module. Replace ## with that product id number and change example.com to your WordPress domain and that’s all.
https://example.com/checkout/?add-to-cart=##&quantity=%QUANTITY%
You can also set Auto-approve to No in the payment module in MDS if you want it to only mark orders as complete in MDS once they are marked complete in WooCommerce. Note that you may have to manually set orders in WooCommerce as complete if they stay stuck in processing.
Clear Cart
This option allows you to clear the WooCommerce cart when MDS products are added to it. This can be useful to prevent users from ordering too many accidentally or removing other products to prevent conflicts if they should arise.
Creating Million Dollar Script Pages in WordPress
Once you install this plugin it will will enable some shortcodes that you can use to display MDS in your pages in WordPress.
It will also enable a new Million Dollar Script block for the built in WordPress block editor. This makes it a lot easier to add pages.
To add a block create a new page and click either the blue + sign on the top left or the black one in the page area. Search for Million Dollar Script and click it. Then you can edit the options. See the shortcodes below for recommended default values for each page.
Grid
Grid pages will display the grid image itself.
[milliondollarscript id="1" display_method="ajax" align="center" width="1000px" height="1000px" mds="https://pixels.example.com" lang="EN" type="grid"]
Users
The users page will link to the /users MDS page which allows users to login and order pixels.
[milliondollarscript id="1" display_method="iframe" align="center" width="100%" height="auto" mds="https://pixels.example.com" lang="EN" type="users"]
List
The list page shows a list of all ads on all grids.
[milliondollarscript id="1" display_method="ajax" align="center" width="100%" height="auto" mds="https://pixels.example.com" lang="EN" type="list"]
Stats
This displays a stats box showing sold and available pixels.
[milliondollarscript id="1" display_method="ajax" align="center" width="150px" height="60px" mds="https://pixels.example.com" lang="EN" type="stats"]
Thank you
This is used to thank users and complete orders properly. It is redirected to from after they come back from payment processors. The gateway parameter must be set to the appropriate payment gateway. Currently a separate page must be created for each payment gateway you use. This is only necessary if not using WooCommerce.
[milliondollarscript id="1" display_method="iframe" align="center" width="100%" height="auto" mds="https://pixels.example.com" lang="EN" type="thankyou" gateway="PayPal"]
Validate
This page is required for users to validate their account after they register. This is only necessary if not using Users Integration.
[milliondollarscript id="1" display_method="iframe" align="center" width="100%" height="auto" mds="https://pixels.example.com" lang="EN" type="validate"]
Parameter Descriptions
id – The grid id # as show in the MDS admin under Manage Grids.
display_method – Controls how to display the page. Valid values are ajax or iframe. Currently AJAX only works for the grid, list and stats. The rest are coming.
align – Controls the alignment. Valid values are left, right or center.
width and height – You can set these to any valid CSS values for width and height. Note that you can use auto for the height to adjust the height of the iframe automatically.
mds – This is the URL to your Million Dollar Script installation. No trailing slash.
lang – This is the language code to use for the page. The language code can be found in the MDS admin under Languages.
type – The type of page you want to display. Valid values are grid, users, list, stats, thankyou or validate.
gateway – This is only required on the thankyou type. Valid values are _2CO, authorizeNet, bank, check, CoinPayments, external, LiqPay, PayPal or VoguePay.