Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter zunkytro

    (@zunkytro)

    Ok, so you’ve confirmed me that my method (to put a function into a function called by a add_filter) doesn’t work.
    thanks for that.

    I’ve read many things about hook, but I don’t have any other choice than to use add_filter since this is the only one available by this plugin.

    Yes I need to save the shape_data separately but how?
    by creating a class? by using global variables?

    I’m looking for best practices in my case.

    Thread Starter zunkytro

    (@zunkytro)

    Hi,
    It is a hook filter from a plugin, the only one that the author gave me.
    In this one, nativly made to modify the $shapes_html, he told me that I can retrieve the data I need by using the second arg: $shapes_data

    That’s why I’m using a hook type filter…

    My plan is to extract $shapes_data in another function. That’s why I tried to create another function into the first one to return $shapes_data only. A function that I could call wherever. But it doesn’t work.

    I could ask my author pluggin, and he probably will send me a code that does the job… but I would like to understand… how to pass theses datas.

    Thread Starter zunkytro

    (@zunkytro)

    Hey mate,
    I’m going to take the time to evaluate the performence’s impact (loading speed / request) between keeping Yoast or your using SEO Framework + another breadcrump dedicated plugin as you suggested.

    To be honest, if I finally take the decision to use SEO framework + another breadcrup plugin. I’ll re evaluate my rate.

    But I wont put 5/5 stars.
    You have to understand what your customers need. At the moment, they need what Yoast does. And the Breadcrumb of Yoast is one of the best thing they do.
    Open your eyes, create an extansion for front end breadcrumb and then everybody will switch from Yoast to SEO framework.

    You have to adapt your plans in regard to the actual market my friend.

    • This reply was modified 5 years, 6 months ago by zunkytro.
    • This reply was modified 5 years, 6 months ago by zunkytro.
    • This reply was modified 5 years, 6 months ago by zunkytro.
    Thread Starter zunkytro

    (@zunkytro)

    wooow it hits me again !

    This post has been held for moderation by our automated system and will be manually reviewed by a moderator.

    xD this time I wait before rewriting ! haha

    • This reply was modified 5 years, 8 months ago by zunkytro.
    Thread Starter zunkytro

    (@zunkytro)

    Hi my friend !
    I so appreciate your “global explanation”. You can’t imagine how much it is valuable for me.
    I wrote my first quite big script using: HTML/PHP/JS/AJAX and using my PDOCRUD plugin to be able to manage queries & Mysql connection and I’ve adapted Bootstrap, fullcalendar etc. to my script !!
    That’s so crazy how much I feel confortable since our last exchange (when I was almost giving up) ! xD
    I’ve spent few tens hours learning, but I’m very happy it worth.

    Now I want to clear my script:
    I’ve made my own php file to store my custom php functions?
    1) I would like to know how to store/call some custom js functions? in the same php file?

    2) because this place is called www.remarpro.com xD I also have a WP question…
    I’m interested by building my own Theme (to increase perf, security, flexibility and to be able to switch easiestly ‘one day’ to Gunteberg)
    At the moment I use a theme that suites with my pagebuilder.
    But, it requires some 3rd plugin, many CSS classes… anyway that’s too much for me..
    I’m looking for a tuto (or anysource) to learn how to build a custom theme…
    At the moment, I only find very old… or very ‘simple/basic’ one: I need several template page for my Homepage, Article, Portfolio, etc.. So I need to understand how to build this logic.
    Again, I don’t care so much about technical code, but much more about global understanding: important’s steps!
    I feel it’s rarest to find global understandable informations than technical informations! it’s more difficult to write the good question to ask than to find the response ! anyway xD

    see you !

    • This reply was modified 5 years, 8 months ago by zunkytro.
    Thread Starter zunkytro

    (@zunkytro)

    edit:
    It seems queries and script from PDOCrud are in .js
    It think operations with DB are done in .js (that’s probably why it s faster than php?)

    The new idea could be to call the query (loading/refreshing array) directly in .js ?

    Thread Starter zunkytro

    (@zunkytro)

    hi bcworkz !!

    it works ! ??

    <?php
    require_once( dirname(__FILE__, 4) . '/wp-load.php' );

    (I’ve changed the location of my script: /www/wp-content/plugins/customCRUD (instead /wp-admin/).
    and now it’s works I understand the aim of the div #load_me.
    Thanks you so much because you definitly helps me a looot.

    Next step could be to:
    1) Use Ajax calls
    2) Replace the PHP snippet pluggin by writting functions in function.php wp_enqueue_script() & using jquery (if I’ve understood)
    I think that could help me in an other project: building my own optimized theme.

    Just to let you know my actual project: I’m trying to build a CMS under wordpress, sourced by SQLite DB + MYSQL DB + external API xD
    Of course, just for passion (my job is NOT to dev xD)

    Everything is new, wordpress, mysql,php ajax, js jquery and I’m not very good in english…. there are 6 months ago I wasn’t able to instal wordpress by myself and today I’m on this forum speaking to you about this kind of crazy things xD
    I’m happy, but my girlfriend is not hahah

    Edit: Crazy thing: the post which had disapeard seems to be appeared again ?? (look at above)

    To be honest, I’m not really happy with my “idea” to load a php script

    <script>
    function charger_page() {
    $('#chargement').load('/wp-content/plugins/customCRUD/0-page2.php');
    }
    </script>
    
    <a href="#" onClick="charger_page();">Charger la page</a>

    The plan was to update the content of a WP bloc without updating/refraishing(loading) the full WP article. it’s nice because it works, but it’s bad because it’s long ^^ (I though it would be faster to load the bloc).

    So, I conclue that loading the script.php is not the best idea. In fact, my script is a script from PDOCrud (which is a plugin) which build $object to query the MYSQL DB (associated to wordpress db) to build form and arrays etc.
    My initial plan was to isolate once of this script in a page.php called in a WP bloc, and then .load it to refresh the query of the script. It would be awsome to be able to load the “only” db query of the script and not the complete page.php ….by refreshing/loading only the $obj built by the plugin.

    any idea? (I think it can be not clear at all xD)

    • This reply was modified 5 years, 8 months ago by zunkytro.
    • This reply was modified 5 years, 8 months ago by zunkytro.
    • This reply was modified 5 years, 8 months ago by zunkytro.
    Thread Starter zunkytro

    (@zunkytro)

    Hey !

    Thanks a lot for informations again, this kind of explanation helps so much.

    But my brain was full after reading your msg xD by seeing the amount of work/learn still needed to accomplish my aim ??

    anyway… step by step… maybe…

    Another newbie question: is there a differency between loading speed by using the AJAX called or by using wp-load.php method?

    I’ve also contacted my Dev’s plugin author and he’s also redirected me to AJAX method.
    Unfortunatly, at the moment it’s not th time to celebrate any improvement xD haha

    • This reply was modified 5 years, 8 months ago by zunkytro.
    Thread Starter zunkytro

    (@zunkytro)

    hi bcworkz,

    Thanks a lot for links & explanations.
    Your post made my day and saved me ton of time (I’m this kind of newbie who doesn’t learn by the begining… so sometimes, basics things/principles can be very very long to undestand.. )
    Now it’s time to undestand all this parts xD

    About the PHP class declaration that’s missing, I thought because the script written in 0-page1.php was already loaded in the page, anything were missing.
    In fact, when my WP page is loaded, both my blocs are loaded without any error (even the one contening 0-page1.php.
    But when I try to press the button (with Jquery) to load again/refresh the 0-page1.php then it miss some PHP class declaration..

    I’m going to try to properly initializing the WP environment as you adviced me and I’ll come back here at the next error ??

    Thread Starter zunkytro

    (@zunkytro)

    I try to rewrite my long last reply that has desappeard =/

    Thanks a lot for your answer !

    1) about Jquery, do you mean some pluggins enabling to write Jquery snippet in headers?
    do you have some advice? link or source? =)

    2) I forgot about WP update ! thanks, I ll put my custom files in secure path !

    3) about Php, I use this plugin at the moment only to play with some PHP script to make some tests. Later, in production, I would love put php script without introducing security vulnerabilty… So, if you have some advice, best practices or any source? =)

    4) About the div id load_me, is it obligatory to use an ID to load a custom page? (yes I’ve done it without knowing why xD)

    5) my page 0-page1.php works fine ! but when I try to load it again (with located file ?? ), it results:
    Fatal error: Uncaught Error: Class 'PDOCrud' not found in /home/xxx/www/wp-admin/0-page1.php:3 Stack trace: #0 {main} thrown in /home/xxx/www/wp-admin/0-page1.php on line 3
    it seems the CSS class of the plugin (PDOCrud) called by my script (in 0-page1.php) is not loaded/found…
    I don’t know if I’m wrong or if I should contact my pluggin dev ?

    thanks!

    • This reply was modified 5 years, 8 months ago by zunkytro.
    • This reply was modified 5 years, 8 months ago by zunkytro.
    • This reply was modified 5 years, 8 months ago by zunkytro.
    • This reply was modified 5 years, 8 months ago by zunkytro.
    • This reply was modified 5 years, 8 months ago by zunkytro.
    Thread Starter zunkytro

    (@zunkytro)

    hi,

    Thanks a lot for all this informations, it helps me a lot.

    1) About Jquery, even if Jquery scripts already works in my page, I would love to know what is the preferred way to use it? I saw some plugins that helps to put snippet in my headers (that’s what you refers?) If you have any link, tuto, or others source.. I need to learn =)

    2) thanks a lot for your advice to put my custom files in my theme (I forgot about WP updates.. )

    3) About plugin allowing php, I use it at the moment to do some PHP tests (I’m trying to build a CRUD app ^^ in my wp website) BUT, later I would need to know how to add some script in my WP page/article without introducing security vulnerability. Could you tell me more about bests practices? any source would be appreciated !

    4) about the load_me div, is this obligatory to use an id ?

    5) yes 0-page1.php works without error.

    After hard coding the location of my script, it seems to try to load the right file now, but I get this error:

    Uncaught Error: Class 'CRUDplugin' not found in /home/xxx/www/wp-admin/0-page2.php:3 Stack trace: #0 {main} thrown in /home/xxx/www/wp-admin/0-page1.php on line 3

    The script I’ve wrote in 0-page1.php calls a WP pluggin (called CRUDplugin).. it works.
    but when I try to “load” the script again then I get this message.

    maybe I should contact the dev of this pluggin.. ?

    • This reply was modified 5 years, 8 months ago by zunkytro.
    Thread Starter zunkytro

    (@zunkytro)

    Hey thanks for your response.
    As I’m a newbie in code, it takes time to me to understand all points in your response and worse to find the code to replace.

    1) In my 2 wp blocs, there are array called by Jquerry (so I’m pretty sure Jquery is already loaded).

    2) I’m not sure about the syntax: https://mywebsite+path/wp-admin/page1.php ?

    3) I use a third part Pluggin to be able to load my php (or my file.php) through my WP blocs.

    4) Does it mean that my page2.php should be placed between <div id=”load_me”> </div> ?

    Thanks a lot, that helps me !!

Viewing 12 replies - 1 through 12 (of 12 total)