WordPress Change title from plugin based on post or page ID

Hi Guys, There are times when you write a plugin that has to create a page and the page contents would be a shortcode handled by your plugin. Now when thats the case your landing page title will always be the same. Question is how we can change it depending on your post or page ID. This post will just give you an Idea but the final pen up has to be done by you. Look at the function below that defines a filter function that you will modify and add it to your plugin file [crayon-62b9e993b6321139261251/] Few assumptions in the above code but as a plugin dev you will understand what those are Now In you main plugin file just add filter to handle filter hook called wp_title as shown below [crayon-62b9e993b632b443795354/]   That pretty must it. Now if you are in doubt please use comments to ask questions so that others including myself can reply. I hope this helps Cheers, Advertisement … [Read more...]

WordPress bot detection plugin lite

Hi Guys, Update Pro version is now available It is my utmost pleasure to be working on another plugin that is now on offer. The plugin is called jaspreetchahal's wordpress bot detector lite, This is FREE version so enjoy.  I think I am too obsessed by my name that It is sort of becoming a norm to include it in whatever I do :) May be I have to get rid of this habit. Ok so let me explain what this plugin does. This plugin will detect if any of the following bot visited on any of your posts or page Ads Bot Google Alexa Alta Vista Google bot Yahoo Seeker You can always go Pro that will have support for over 50+ bots, spiders and crawlers out of the box. To start with here is a screenhot of the settings page  Email Screenshot Ok let me explain what above fields are for Notification Email: This is your email address where you would like to receive notification on which pages has been crawled by a given bot during the interval set by you Email Interval: This is the interval that you set between Emails. So say an email has been sent at 1 PM and your email interval is set to 2 hours, thus the next email will be sent at 3 PM with results taken from those 2 hours. Keep history for: This is detectors results store limit. So you are saying, don't keep history for more than 30 days. This is recommended because based on the number of webpages on your site this table size can get out of control if higher limit is set. Email format: Both HTML and Text client are supported.   So now we got an Idea what this plugin is capable of. Data transmission When you activate or deactivate the plugin, this website will be notified for, No information other than your website address and plugin meta data is sent across. Please let me know if you are not comfortable with it so that I can direct you what to do. Getting Help Use comments to get help if you don't understand any part of this … [Read more...]

WordPress display external website feed in plugin admin settings page

Hi Guys, There are times when you would want to display your website feed in the Free plugin or even in paid ones to your plugin users in the administration area of your plugin. I use feedburner to manage my feeds. Good thing about Feeburner is that it makes your feed browser friendly. To start using Feedburner create an account with Google and Goto this URL http://feedburner.google.com Now once you map your website feed to feedburner you will be given a unique URL to your feed. So each website will get a unique URL. Once you got hold of the Feed URL here is what you can do. Below is the end result of what I am going to do   Ok so I will be using the fetch_feed function that comes out of the box with wordpress and is really handy. Below is a function that you can use within your plugin [crayon-62b9e993b8292368108576/] Ok so the above function can be read as Give me last 5 posts from jaspreetchahal.org and make every post a link so that user can read it. I hope that this could be helpful to you because there are times when you don't know where to start. If you would like me to extend this post to use this function in a plugin please let me know but to give you a hint that wherever you call the statement below, your feeds will be displayed. e.g. on your plugin administration screen call this statement. echo jcorgfeeds() ; Given that the file in which this function lives is accessible and included in your plugin file.   The purpose of this post was to give you an Idea what you can do with built in API offered by wordpress. Cheers,   Advertisement … [Read more...]

WordPress: What if I accidently deleted my old post and have no backup

Hi Guys, This happens sometimes when you are thinking about your girl friend or boyfriend :) Ok I understand that you don't have the database backup and you somehow wants to restore your post. I assume at least you remember title of your post. Right? If not then there is no use reading this article further. Ok so you do remember post title, lets continue then. We will be using our well wisher Google to assist locating your content. First go to google.com Now type this in the search box (replace domain name with your and article title with your post title) as shown below   Ok from here on hover on top of you post your will see a shaded double arrow pointing to the right i.e. >> Do not click that just hover as shown below   When you hover you will see a page that you've deleted. Wow! This is because Google caches your data for some day. That's so cool. Now click on the cached link that appears besides the link on hovered pane as shown below   Yippi when you click on the link that's it you get whatever Google have cached for you. Something is better than nothing. There could be other ways including browsing your browser cache but I found this method to be really helpful. Google cache is not updated everyday by the look of things so you are guaranteed to recover some of your lost content. The content that you've changed in last few days may not be recovered using this method. This method will not work if your post of webpage has not been crawled by Google. I Hope this helps Cheers   Advertisement     … [Read more...]

WordPress Add Custom Media buttons over Post Editor Toolbar

Hi Guys, I am really so pleased to write this one. I am sure that this article will be modified so many times in future based on your feedback and suggestions. There are many ways to do certain things in wordpress and below is what I've got for you. But first check what the final result will look like. Advertisement   Now I have to hack into the wordpress code to see how they do it because I couldn't find some documentation on their website about this. Ok this this was my approach. We know that in the above image we have string called "Upload/Insert" If you search for that string in the Wordpress Files you will notice that that string exist in file /path/to/wordpress/root/wp-admin/includes/media.php Line 376 I am gonna use that concept and try to manipulate to get to the above result. Lets add an action first for our media button [crayon-62b9e993b854c356676343/] Media buttons context is associated with media buttons Now lets add a handler function called jcorgbuttons [crayon-62b9e993b8552095517999/] Now as you can see that we are accepting media button context and lets do something with it. What I am gonna do here is to append our button to that context as shown below [crayon-62b9e993b8554586489571/] This tell WP that while you are doing Media Buttons Please accept mine too. Just by doing the above you will see what I have shown in the Image above. Now by itself it does not mean anything so lets open an external page or your plugin settings page. You can choose any page you like. I will now add an action below to create an admin menu page [crayon-62b9e993b8555447958354/] Now that everything is set we'll go back to our jcorgbuttons($context) function and change it to this [crayon-62b9e993b8556095702474/] Now we are launching a thickbox and we are specifying TB_iframe (means is Thickbox an iFrame) to true. Now with this change when you click on the button or icon … [Read more...]

How to publish a plugin to WordPress Successfully – Step by Step Guide using Tortoise SVN

Hi Guys, I would like to take this opportunity to put this topic on table. Now that I have released my first plugin on Wordpress platform. I can share my experiences with you. I assume that you've got your plugin properly tested and there are no known issues with it. But just so that I am comfortable taking you to the next step please ask your questions below Do you have an account with wordpress? If your answer to above question is NO then create one from here  http://wordpress.org/support/register.php Do you have Tortoise Subversion? If your answer is NO. Then download the tool from here. http://tortoisesvn.net/downloads.html Do you have "Powered by" by link in your plugin and your plugin does not offer user an option to take it off? Very Bad. Make sure that you give your plugin user an option so that they can turn it On if they wish. Default value of your setting should be Off. In technical or HTML talk your checkbox should be Unchecked. Do you have Readme.txt file in your  plugin directory root? Create one. Follow the instructions from here http://wordpress.org/extend/plugins/about/readme.txt Ok so now that we have made through the basic checklist. Next thing we would like to do is to create a Plugin Submission request Click on the URL below and create one for your plugin. In a good time a wordpress enthusiast will get back to you normally within few hours after your plugin request submission. Ok so here is the URL http://wordpress.org/extend/plugins/add/ In the plugin URL field you can either point to a webpage where an admin can download your plugin from or you can put a link directly to your ZIP file. I will recommend the latter. Now that you've create the request, wait till you get an approval from Wordpress. When you get an Approval you will get an email something similar to one shown below Your plugin hosting request has been approved. Within one hour, you will have access to your SVN repository … [Read more...]

WordPress Coupon Plugin

Hi Guys, Update: Version 8.5.0 (2019 edition) is out now with many improvements and new features. Check out the change log for details. To upgrade from the previous version just deactivate the old version and overwrite with new files. Please make sure that you make a copy of the existing files. Copy the files across and Activate again. DON'T forget to clear your browser cache (just in case)! To get version 8.5.0, you must be a current customer and have purchased version 7 (Upgrades to version 7 are not eligible for free upgrade). Else please email me so we work something out. 100% compatible with WordPress 4.9+ This is my utmost pleasure to introduce you to this plugin called Wordpress JC Coupon Revealer. Best compliment you can give me is to recommend it to your mates. You may have tried the Lite version of this plugin and thought of upgrading to the Pro version. That's really great. Now, I don't really have any hard and Fast rules. You Pay once and you can use it on the website owned by you. Check out the licensing section for more details later in this post. Get further 10% off with coupon 10OFF - Limited time only Purchase PRO Now for $59 (40% Off) Purchase Unlimited Sites PRO Now for only $99 (40% Off) Change Log for version 8.5.0 (Re-released Sep 2018) Compatibility with Wordpress version 4.9.8 HTTPS compatible   NEW STYLE (Bare Minimum) IN VERSION 8 Example     Change log for other version >> What do my customers say about this plugin This is an extremely flexible, well maintained coupon plugin that is backed by exemplary customer support. Plugin could not be easier to use and will surly fulfill your needs. I would highly recommend if you are looking to run any sort of coupon based promotions. Brian - http://www.altecdesign.com Jaspreet, Thank you so much! I found so many options that has so many features and functions that I just didn’t need. I really was looking hard for a simple, easy … [Read more...]

Free wordpress coupon plugin

Perhaps one of the best free wordpress coupon plugins out there. I created this plugin to make life easier for myself when it comes downs to coupon management. I am pretty sure that this will help you too. Let me go through some key features that you are going to get in Lite version of this plugin. Version 8.5.0 (Nov 2016 Edition) is out now. ChangeLog: Improvements and bug fixes NEW: Flash detection NEW: Copy to clipboard functionality will fallback to normal Javascript to open affiliate links NEW: Copy button will hide properly if flash not found in iFrame view NEW: WordPress 4.4+ compatibility NEW: Style 9 will have social share button on mobile and tablet platforms too. Print button has been taken out for these platforms though. Fixed: Clean Style would force coupon click to open invalid tab Fixed: Style 2 would have bigger cover to hide coupons Fixed: A couple of issues with Style 9 (Responsive) and so much more View PRO Details and Purchase   Ok So let's check what features this plugin has Got? Add Coupons to your Posts and Pages Destination URLs are masked Many styles and many combinations to create a right coupon for yourself. It can carry Title, Description, Savings message and Expiry date Live preview while you create your coupon You can add coupons that never expires with custom Expiry text option. The only way someone can get a coupon is with a Click. However you can choose to show your coupon and Click is not necessary then. Coupon gets copied to clipboard when your visitor clicks on wrapper layer and are then taken to the affiliate website. When coupon expires it will just disappear from your Posts or Pages Very handy Coupon management Custom date format Ability to reduce bounce rate User can Vote whether Plugin worked for them or not so that you can take an appropriate action. Many other features are available in PRO version. At the end of this Article I … [Read more...]

WordPress Using Media uploader in your plugin

Hi Guys, I have to agree that with wordpress, possibilities are infinite (may be). As I am still learning Wordpress API and still have to master the art of Hooks and Crooks (I mean filters) :), I had developed very basic plugins for my couple of website but they were really basic. So everyday with Wordpress I am learning something new. Last week I learned how can I use the available Media Uploader that ships with Wordpress. So rather to reinvent the wheel, you can use whatever is already available Ok so lets get started. First You will need couple of includes so in you admin_init action or whichever hook you are using to enqueue the scripts put this code there wp_enqueue_script('thickbox'); wp_enqueue_script('media-upload'); wp_enqueue_style('thickbox'); This makes sure that thickbox (modaled window) and media-upload scripts are available. As you notice that we've imported thinkbox style too. Wordpress knows where these scripts are so you don't have to worry about the paths here. Ok So this is done Now we will create a very basic form as shown below. This form will be on one of your Admin pages. [geshi lang="html5" nums="1" target="_self" ] Upload CSV Upload your CSV file.. Advertisement   Now that our HTML Form has been setup lets do some jQuery magic to open media uploader page. you can place this script just under your form or you can include it in your JS file. because we are using document.ready (pseudo) so the script wont execute until the page get loaded completely. [geshi lang="javascript" nums="1" target="_self" ] [crayon-62b9e993be57d040251596/] [crayon-62b9e993be587976870619/] Ok so this way we will have our file or image uploaded and have path of the Image which we can store in database or do other manipulations.   I hope this Tip will help you. I will be writing on how to add custom buttons on top of content editor soon so stay tuned Till then … [Read more...]

WordPress SMTP settings

Hi Guys, I am developing a plugin for wordpress and it is soon to be launched. While developing this plugin I wanted to test email functionality that is built in. WordPress uses PHP's mail function to send email So to send message to external email address your local machine should be able accept your message for relay in other words localhost is by default seen as a mail server. In other words Wordpress doesn't have any its own settings to configure a SMTP server. It assumes PHP's mail function is working properly to send emails. With Linux I guess either sendmail or postfix are used my many distros and are good enough to accept and send email to localhost user email address. For *IX machine check where your php.ini file is and provide path to sendmail in following setting [crayon-62b9e993bf894907982970/] But if you are running Windows box for you plugin development, then changing main PHP.INI file is what you are looking for. So look for these settings [crayon-62b9e993bf89a274004570/] [crayon-62b9e993bf89c924980064/] and make changes accordingly. bottom line is that the SMTP server you will be using should accept anonymous emails and it should accept emails from your development host IP too. I can cover more advanced setup for mail servers but that's not this post is about. Now you can also set wordpress to work with gmail etc. i.e. external Mail Servers In wordpress 3.3.x Open /wp-includes/pluggable.php and you will find function called wp_mail That's the function that is used to send emails right! On line number 210 you will see this declaration [crayon-62b9e993bf89d987652342/] Just below that you will find that it gets initialized if its missing. Now on line 394 you will find this declaration [crayon-62b9e993bf89e340425938/] Change above to this   [crayon-62b9e993bf89f261565731/] You have 2 options here. Either to append these lines and after the above … [Read more...]