Forum Replies Created

Viewing 15 replies - 121 through 135 (of 3,259 total)
  • I started my plugins journey with this plugin, it showed me little bits of many techniques:
    https://wordpress.org/plugins/wp-csv-to-database/ Author: Ruhul Amin

    I would modify the plugin to do different tasks, each with its own button. One would be “add row to grid, it would have one field in its form, “keyword”. The code which handled the form submission would add that keyword to the table.

    Another part of the plugin admin page is the grid. Probably a table of one column, each row containing a form displaying the phraseID and keyword and each language/multisite’s text, and a button for UPDATE and DELETE, this could be a table of one row and multiple columns. The DELETE button would delete all rows from the database with that phraseID. The UPDATE button would create a list of (a,b,c) entries and submit an SQL INSERT command, with a variation “on duplicate key update”.
    It is extremely important that you use the “prepare” statement to construct the SQL statements using the fields submitted to it, without this you are vulnerable to SQL INJECTION attacks, an attacker can control your whole website.

    Each submit action does the specified action, and reports upon the status of this action. Then it re renders the page, displaying the options and the new grid.

    A different treatment would use AJAX.

    Some thoughts, not pretending to be a complete solution.

    While it is possible to save data like your translated keywords into the “options” table, I would advise against this in your case as you want this data to be accessible across your multisite. Hence I would advise you to use your own custom table that is outside the WordPress table set, this means that the rest of WP will not know about it, and that a plugin can access it regardless of which multisite is in use.

    Also initially I would hardware the multisite/language index into the code, later if required this could be generalised and be maintained in a different custom table.

    I would setup the primary custom table to have the following columns:
    a – phrase id
    b – language/multisite id
    c – varchar text
    Keys would probably be (a), (b,c)
    Queries would most likely be along the lines of a join on (a) within the same table where (b,c) are specified,

    For creation and maintenance I would have the plugin register a shortcode to edit/add/delete entries in the table. First thing in the shortcode would be to check that the logged in user was a multisite administrator, else exits with “You are not authoised to do this, etc”. Then the shortcode function would fetch the whole of the translations table and output it in javascript arrays to your table edit page. Javascript would dynamically present the data in a table, javascript functions would be able to re-render the table sorted on different columns and also do searches. Edits and Additions or Deletions would be passed back to the plugin using AJAX which would update the table.

    Multisite clients would have a different shortcode to fetch the required text based on their language and the key phrase.

    You can only use one theme at a time.
    What I would suggest is that you retain your theme and use the “child theme” mechanism to “borrow” the elements you need from your second theme.
    Details on setting up a child theme here:
    https://developer.wordpress.org/themes/advanced-topics/child-themes/
    An alternative is to use:
    https://github.com/woothemes/theme-customisations

    I configure my webserver to use the “virtual host” method, and use the hosts file mechanism to map domain names to my localhost server.
    More details here:
    https://httpd.apache.org/docs/current/vhosts/
    https://en.wikipedia.org/wiki/Hosts_%28file%29

    I develop the website locally using the final domain name, I can switch between local and hosted by commenting out the lines in the hosts file.
    Some people use a browser plugin to manage the hosts file.

    Try:

    .page-id-450 .site-header .main-header-bar {
    background: rgba(0, 0, 0, 1.0);
    }

    I started my plugins journey with this plugin:
    https://wordpress.org/plugins/wp-csv-to-database/ Author: Ruhul Amin

    Forum: Fixing WordPress
    In reply to: My webs are hacked

    First off don’t panic.
    These articles will help:

    FAQ My site was hacked


    https://codex.wordpress.org/Hardening_WordPress

    You will find these articles informative:
    http://smackdown.blogsblogsblogs.com/2008/06/24/how-to-completely-clean-your-hacked-wordpress-installation/
    http://smackdown.blogsblogsblogs.com/2012/11/14/hacked-on-hostpapa-or-netregistry/
    http://ottopress.com/2009/hacked-wordpress-backdoors/

    First you need to stop them getting back in.
    Change the passwords on:
    – hosting management login, probably cPanel
    – all WordPress administrators
    – the WordPress database user and password in your wp-config.php file

    If you are on shared hosting, each website should have its own database, and use a different database user / password set.

    Install one of the WordPress security plugins.

    There is:
    Contact Form 7’s reCAPTCHA integration module

    On your dashboard. In the left hand menu: Contacts > Integration
    Enable and configure the required google keys.
    Add field to form.

    Another possibility is that while you have file edit permissions on the image as an interactive computer user, is that your apache webserver program does not have these permissions.

    This is quite likely a PHP 8 related problem.
    Most likely your plugin: child-theme-check is not suitable for PHP 8
    Suggest that you disable this plugin and test again.
    To disable a plugin:
    – if you can login as administrator the just disable in the dashboard
    – Otherwise, browse your files and rename the plugin directory

    Firstly you should expect to be customizing your chosen theme as a child theme, this is an update safe method. Details here:
    creating a child theme http://codex.wordpress.org/Child_Themes
    If you find yourself choosing a child theme as a base then this may be relevant:
    https://github.com/woothemes/theme-customisations

    There are a bewildering range of themes to choose from, I think that “the look” is low in the criteria, again my opinion is that aspects such as viewing context be it Mobile / tablet / browser etc. Then there is integration as out of the box support and configuration with various plugins such as WooCommerce, this can save you a lot of work if your usage indicates. Finally it comes to the look, do you have a website colorscheme in mind, is it dark or light ? What about logo ? See how this relates to a theme’s header and footer, also sidebars etc. Yes you can customise any aspect of a theme but this has a longer reach than one would expect. For instance I inherited a website which had been changed to a dark background in the child theme, years later I find that filling in an alternate delivery address is impossible as the text did not contrast with the form background.

    Building your own theme is a whole lot more work.

    Forum: Fixing WordPress
    In reply to: Cannot connect db

    I googled on:
    “PHP Warning: mysqli_query(): MySQL server has gone away”
    maybe this will help.

    Otherwise I suggest that you seek support from your website hosting.

    Suggest using one of the html / css validation websites to test your website pages, if you do have errors then various browsers on occasion behave differently. Like some browsers behave along the lines of “you made a mistake but I know what you mean anyway”, while others are bewildered.
    Maybe ask in support forum for your theme.

    Along the lines of what a2hostingrj said.
    There are many WordPress sites doing ecommerce.
    WooCommerce is by far best known, however I would encourage you to investigate and test on a small scale other solutions. There are also other open source ecommerce platforms.
    Your 40,000 products is not a problem, issues such as transactions per hour should be investigated.

    I have built applications on WordPress that do this, so it certainly is possible.
    You can write your code in two different ways:
    – Create custom page templates in your theme, presumably a child theme.
    – Write a plugin that registers shortcodes. Reference these shortcodes in your pages / posts and your code creates the displays.

    One application is a genealogy wiki, subscribers input data about people in their family and connect to their relatives. Quite quickly the who ancestral village was covered, descendants around the world documented their family trees.
    Another application scored contests, judges input scores and comments against the entrants, administrators supervised the progress, at the end participants viewed their results and reports.

    There are also two different ways you can do the graphics (I have not done this very much):
    – html5, runs on your server
    – canvas: runs in javascript on the browser

    Be aware that you will need considerable proficiency in several computer languages. My systems use a mixture of:
    – PHP
    – HTML and CSS
    – SQL
    – javascript including AJAX

    • This reply was modified 5 years, 2 months ago by RossMitchell.
Viewing 15 replies - 121 through 135 (of 3,259 total)