ThemeForest

Question to WP plugin developers from WP plugin developer

259 posts
  • Argentina
  • Sold between 50 000 and 100 000 dollars
  • Author had a Free File of the Month
  • Most Wanted Bounty Winner
  • Bought between 50 and 99 items
  • Referred between 50 and 99 users
  • Microlancer Beta Tester
  • Exclusive Author
+1 more
DPereyra says
As ichurakov mentioned, just this: wp_enqueue_script("jquery");

No “deregister”, no “register”, just the wp_enqueue_script(“jquery”) is enough, I never had a problem with it in any wp version.

212 posts
  • Has been a member for 0-1 years
  • Exclusive Author
  • Microlancer Beta Tester
  • Sold between 5 000 and 10 000 dollars
  • India
  • Bought between 1 and 9 items
nCrafts says

As ichurakov mentioned, just this: wp_enqueue_script("jquery"); No “deregister”, no “register”, just the wp_enqueue_script(“jquery”) is enough, I never had a problem with it in any wp version.

Using plain enqueue will not give an error, but there is a change that the user might end up loading jQuery multiple times if he is using an assortment of plugins.

689 posts
  • Sold between 5 000 and 10 000 dollars
  • Exclusive Author
  • Croatia
  • Bought between 10 and 49 items
  • Has been a member for 1-2 years
OriginalEXE says


As ichurakov mentioned, just this: wp_enqueue_script("jquery"); No “deregister”, no “register”, just the wp_enqueue_script(“jquery”) is enough, I never had a problem with it in any wp version.
Using plain enqueue will not give an error, but there is a change that the user might end up loading jQuery multiple times if he is using an assortment of plugins.
Wrong, you can have wp_enqueue_script(“jquery”) 1000 times, only once will jQuery be called, that’s the beauty of it :)
246 posts
  • Exclusive Author
  • Has been a member for 1-2 years
  • Microlancer Beta Tester
  • Sold between 1 000 and 5 000 dollars
Typps says

Thanks for the answers… But is there any developer online who used a correct include in a plugin which was accepted on CC? Can he/she please tell us the exact way of doing this? I am still confused how should I include the jquery js at the begiing of my plugin withour breaking other plugins or the theme. Thanks

From your initial post, it appears that you are deregistering jquery to register a custom version of jquery. This can potentially break other plugins and themes. So try not to do that. Limit your deregistrations to scripts that are specific to your plugin. Jquery on the other hand is included by default in wordpress and it’s something that most plugins/themes rely on.

As already suggested, wp_enqueue_script is your friend here.

For the record, jquery not available in versions below 3.5 is not true. You can download one of the older archieves to verify, look in the following path : wp-includes\js. Probably been bundled since wp 2.6. Of course the version number of jquery will vary as the wordpress version gets older, but IMHO that is a problem best solved by the user, i.e. upgrading their version of wordpress.

212 posts
  • Has been a member for 0-1 years
  • Exclusive Author
  • Microlancer Beta Tester
  • Sold between 5 000 and 10 000 dollars
  • India
  • Bought between 1 and 9 items
nCrafts says



As ichurakov mentioned, just this: wp_enqueue_script("jquery"); No “deregister”, no “register”, just the wp_enqueue_script(“jquery”) is enough, I never had a problem with it in any wp version.
Using plain enqueue will not give an error, but there is a change that the user might end up loading jQuery multiple times if he is using an assortment of plugins.
Wrong, you can have wp_enqueue_script(“jquery”) 1000 times, only once will jQuery be called, that’s the beauty of it :)

Yes, found out :D

282 posts
  • Microlancer Beta Tester
  • Bought between 10 and 49 items
  • Sold between 1 000 and 5 000 dollars
  • Europe
  • Has been a member for 0-1 years
  • Exclusive Author
greenline says
That’s the way I was using it in my plugin: wp_enqueue_script("jquery");

No de-register, no register, at all. I only used the above piece of code. But from rejection email, I understood that was not the correct way of including jquery, that’s why I asked. But maybe that’s the standard rejection email, so…I think I will not modify my include line.

59 posts
  • Exclusive Author
  • Has been a member for 1-2 years
  • Referred between 100 and 199 users
  • Sold between 10 000 and 50 000 dollars
ichurakov says

2greenline. This is correct way of including jQuery. Just resubmit your item saying that you use WP native jQuery and not de- re- register it.

282 posts
  • Microlancer Beta Tester
  • Bought between 10 and 49 items
  • Sold between 1 000 and 5 000 dollars
  • Europe
  • Has been a member for 0-1 years
  • Exclusive Author
greenline says

I did that and my item was accepted, thank you!

Now: how do I do that for google maps api? In a buyer’s website who uses my plugin, there is a warning saying:
Warning: you have included the Google Maps API multiple times on this page. This may cause unexpected errors.
And the map controls are not rendered correctly indeed.

Now, how should I check in my plugin if there is a http://maps.googleapis.com/maps/api/... already included?

And what if there is version included by another plugin, but I want to use the latest google map api? How do I do that without breaking another plugins?

282 posts
  • Microlancer Beta Tester
  • Bought between 10 and 49 items
  • Sold between 1 000 and 5 000 dollars
  • Europe
  • Has been a member for 0-1 years
  • Exclusive Author
greenline says

One more thing: I want to create a user (in my wordpress live preview website) and I want to give this user the permission to see only a plugin’s settings admin page (without access to editing any other thing in the wordpress admin panel). How do I do that?

The purpose is to allow them to see live the plugin’s back-end settings before buying.

by
by
by
by
by