tag:blogger.com,1999:blog-30349760703150502262023-12-12T16:51:12.102-05:00TIV.NETWeb Development and Consulting Services in Toronto, CanadaTIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.comBlogger76125tag:blogger.com,1999:blog-3034976070315050226.post-16039643204677805292020-02-11T10:50:00.001-05:002020-10-13T08:12:18.644-04:00Paywall for WooCommerce - sell pay-per-view videos and other restricted content"Paywall" is a WooCommerce extension that allows you to create and sell products with restricted access to content. When you install and activate the extension, you’ll be able to create and sell products with exclusive content and allow users to purchase them to “unlock” features.
See Live Demo, download and register for upgrades:
https://woocommerce.com/products/paywall-for-woocommerce/TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-30603531426389577172019-10-04T10:34:00.004-04:002020-10-13T08:12:34.926-04:00WooCommerce Assistant“Assistant” is a WooCommerce store management extension that aims to reduce manual work by automating several routine tasks.
With a simple set of rules, it can schedule sales, tweak prices, run clearance events – all completely unattended.
See Live Demo, download and register for upgrades:
https://woocommerce.com/products/woocommerce-assistant/TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-12449375478133580492018-07-16T21:34:00.000-04:002018-07-16T21:43:21.748-04:00Service worker and 401 authorization
What happens
The website area (/admin) is protected by an `htpasswd` authorization (Apache: AuthType Basic, Require valid-user, etc.).
A "standard" service worker script is loaded at the home page, doing its usual stuff (install, fetch, cache).
When you go to the protected page, you are not asked for the user/password, but see the "Not Authorized" message immediately.
If you clear the service TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-70945554471717485132018-06-21T00:00:00.000-04:002018-06-21T23:45:21.834-04:00Currency conversion in Google Sheets using the GoogleFinance functionFormula:
[A2] --> =INDEX(GoogleFinance("CURRENCY:USDCAD","price",A2),2,2)
Example:
TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-60820843924309603722018-03-06T16:49:00.001-05:002018-03-06T16:49:35.781-05:00ACE Editor: submit, beautify and minifyA code example to use ACE Editor in HTML form, submit minified JS and CSS and beautify it.
This is just a sketch. The server side is not shown.
Developed for use in the WPGlobus Multilingual WordPress plugin's options panel.
TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-39852896713087946292018-01-04T08:54:00.000-05:002018-03-06T16:50:47.933-05:00Cygwin: Permissions 0660 for '~/.ssh/id_rsa' are too open.Environment:MS Windows 8.1
Cygwin 64bit
ssh keys copied from somewhere and placed to ~/.ssh/
Problem:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0660 for '~/.ssh/id_rsa' are too open.It is required that TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-53100496763416477622017-01-15T13:02:00.001-05:002017-01-15T13:02:45.572-05:00Cannot disconnect USB drive? Close the Task Manager!Excuses
Yes, I am still using a WD "Passport" for downloaded movies. Copy on PC and connect the drive to TV's port. Yes, I know that I can stream. Yes, I have a good router. Never mind :-)
Oh, yes, I am still using Windows. Dear Mac users, I love you, too, but not as much as I love Bill Gates :)
<jokes aside>
Problem
"Windows cannot disconnect your USB drive". Close the programs, TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-57524484994089523682016-11-27T00:00:00.000-05:002016-11-27T10:00:10.873-05:00ln -s on Windows? Use mklink for symbolic links !I needed to make Apache server seeing a folder via a symbolic link - on MS Windows. The standard Windows' shortcuts look like links, but Apache does not see them...
Apparently, there is a way to make REAL symbolic links under Windows. (Must run command prompt as administrator).
For example:
mklink C:\etc\hosts C:\Windows\System32\Drivers\etc\hosts
results in
C:\>dir c:\etc2013-01-02 TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com1tag:blogger.com,1999:blog-3034976070315050226.post-8175461488708119222016-09-06T08:33:00.000-04:002016-09-06T08:50:05.083-04:00"Disallow ia_archiver" does not remove pages from archive.org
The experiment (September 2016):
- A site exists since 2008 and has many snapshots on archive.org.
- The FAQ says:
You can exclude your site from display in the Wayback Machine by placing a robots.txt file on your web server that is set to disallow User-Agent: ia_archiver.
- Made the robots.txt as follows:
User-agent: ia_archiver
Disallow: /
- In a couple of days, indeed, insteadTIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-31834140378215690542016-07-14T17:31:00.001-04:002016-07-14T17:31:37.894-04:00Cygwin and ANSI terminal
Problem
I see ANSI color sequences on Cygwin.
Explanation
The default Cygwin.bat runs bash in a Window terminal, which does not support ANSI sequences, so you'll see the color codes instead of actual colors:
$ codecept selfupdate
[37;41m &TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-40699673858225817602016-05-31T00:57:00.000-04:002016-05-31T00:57:56.826-04:00A curious case of "you are not allowed" in WordPressRegister a custom taxonomy. Everything looks great, except for one "tiny" problem: any attempt to Add New results in immediate "You are not allowed" message!
Blame Yoast, of course! :)
He suggested "is_admin, but not DOING_AJAX". So, the "register taxonomy" was hooked on "not AJAX". Oooooopsi!
Re-hooked. Ta-da!TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-17905914477828219342016-05-19T00:40:00.000-04:002016-05-19T00:40:26.999-04:00debug_backtrace and call_user_func in PHP 7Before PHP 7, functions call_user_func() and call_user_func_array() appeared in debug_backtrace() as separate entries. Since the version 7, they do not.
Demonstration code Gist
TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-86656205139244961192015-11-05T21:46:00.000-05:002015-11-05T21:46:23.302-05:00PHPStorm column selection and editingTIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-51393861494918674462015-10-16T14:52:00.001-04:002015-10-16T14:53:29.728-04:00WordPress security : disallow author queryFriday afternoon. Looking at the access log... here are some "nice" requests. Happened at the same millisecond, and look very "hack-ish" to me.
54.80.2.64 - - [16/Oct/2015:18:46:25 +0000] "HEAD /?author=5 HTTP/1.1" 404 159 "-" "-"
54.80.2.64 - - [16/Oct/2015:18:46:25 +0000] "HEAD /?author=1 HTTP/1.1" 404 159 "-" "-"
54.80.2.64 - - [16/Oct/2015:18:46:25 +0000] "HEAD /?author=3 HTTP/1.1" 404 159 "TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-43239452710246541972015-09-29T11:51:00.000-04:002015-09-29T11:58:25.963-04:00WPGlobus multilingual plugin (Checking Facebook post embedding....)(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3"; fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));
WPGlobus will work with any WordPress theme. Some configuration is required to translate the theme optionsTIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-60400242470745291412015-08-12T14:07:00.000-04:002015-08-13T08:15:11.689-04:00PHPStorm: mark a single file as excludedPHPStorm allows to mark a folder as "Excluded" (Go to Project view, right-click on a folder and choose "Mark Directory as... Excluded". Then, all the files in that folder will be ignored by the PHPStorm when it looks for functions, constants, etc. So, for example, if you have an older versions of a library, in "archive" folder, you can exclude it, and Code Inspection will not refer to those olderTIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-24149374575647907162015-08-06T15:46:00.002-04:002015-08-06T15:46:21.392-04:00makepot.php for single textdomain onlyHere is a patch to the entry.php file that allows to ignore all strings that are not from a single textdomain.
Ugly. Hard-coded. Enjoy :)
TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-107024861277515372015-02-19T12:17:00.000-05:002015-02-19T12:17:35.132-05:00Codeception: XPath `...` is malformed!
Environment:
Codeception PHP Testing Framework v2.0.11
Powered by PHPUnit 4.4.5 by Sebastian Bergmann.
Symptom:
* I am on page "/"
* I click "Terms of Use"
XPath `Terms of Use` is malformed!
Cause:
$I->click( "Terms of Use" );
Cure:
$I->click(['link' => "Terms of Use"]);
From the documentation:
http://codeception.com/docs/modules/WebDriver#click
// using strict locator$TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-86602109025976867352014-08-19T14:00:00.000-04:002014-08-19T14:00:15.253-04:00WooCommerce: SQL to fix sorting by dateIn one of the projects, I needed to import a product data from a non-WP website to WooCommerce.
After importing, the "Sort by newness" did not work correctly, because the post dates were all the same.
A simple SQL solved my problem:
TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-29984630103492102172014-05-28T23:32:00.000-04:002014-05-28T23:32:07.510-04:00WordPress Tip: Export WooCommerce category list (SQL, CSV, Excel)Run this SQL in phpMyAdmin, and then click Export link at the bottom to save as CSV for Excel or other format.
Note: tested only on one level of subcategories.
Gist revisions are welcome: https://gist.github.com/tivnet/d9cca4a4f4cfebe143bc
TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-62078445397226308092014-03-20T18:24:00.000-04:002014-03-20T18:36:39.011-04:00SourceTree does not show submodules
(SourceTree is a nice Git client by Atlassian)
The Problem:
SourceTree loses track of Git submodules. The entire "submodules" sidebar section is invisible.
A "clue":
Click the "Terminal" toolbar icon and type
$ git submodule
You should see something like:
dbd34bd2657ef70f001c1d135e2e14adef7dcdb9 dbdump (heads/master)
No submodule mapping found in .gitmodules for path 'wp'
The TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-51765491451515283352014-03-19T20:06:00.001-04:002014-03-19T20:06:12.358-04:00Making a WordPress.org plugin: SVN, GitHub, PHPUnit and Travis-CI [Part 1]This is my first experiment to publish an open-source code. It was quite a "challenge", after years of working exclusively for corporate clients and myself, to write something that can go to "the wild" :-))
WordPress version:http://wordpress.org/plugins/tivwp-dm-development-manager/
GitHub version:
https://github.com/TIVWP/tivwp-dm
Here is a shortened list of what's involved in making a public TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-53733140195007298512014-03-16T13:02:00.000-04:002014-03-16T13:02:23.037-04:00WordPress: How to exclude plugin/theme files from Poedit catalog
► The Problem:
I use some third-party files in my WordPress plugin (or theme). When I run Poedit to built language files, it scans the main plugin folder and puts all text strings found in the .po file, including those from the third-party.
► The Solution?
Vaclav Slavik, the author of Poedit, placed a "wontfix" resolution on that, years ago. See http://www.poedit.net/trac/ticket/359 and http://TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-53497601790732732982014-03-15T00:58:00.001-04:002014-03-15T00:58:59.943-04:00List of Front and Admin WordPress ActionsBelow is a list of core WordPress actions as of WP-3.9-beta1.
I obtained this list by printing the $tag parameter in both do_action() and do_action_ref_array() functions while running a front page and an admin page.
This list cannot be considered complete. Please use it for quick reference only.
Link to the spreadsheet on Google Drive:
https://docs.google.com/spreadsheets/d/TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0tag:blogger.com,1999:blog-3034976070315050226.post-16312328694503274712014-02-26T17:45:00.000-05:002014-02-26T17:45:05.664-05:00"An error occurred in the upload..." (WordPress Media)Seeing "An error occurred in the upload..." message when calling WP Media interface on the front?
I believe, that's a core problem, but here is a workaround that I am using quite often in my projects.
Admins won't have this bug, but regular users - will. Because we are on a page, which $post was not created by this regular user, so he does not have the editing capabilities... and Media needs TIV.NET INC.http://www.blogger.com/profile/12854685811525923831noreply@blogger.com0